cfg.c 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159
  1. /*
  2. * Copyright (c) 2005-2006 MontaVista Software, Inc.
  3. * Copyright (c) 2006-2018 Red Hat, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. * Author: Steven Dake (sdake@redhat.com)
  8. *
  9. * This software licensed under BSD license, the text of which follows:
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above copyright notice,
  15. * this list of conditions and the following disclaimer.
  16. * - Redistributions in binary form must reproduce the above copyright notice,
  17. * this list of conditions and the following disclaimer in the documentation
  18. * and/or other materials provided with the distribution.
  19. * - Neither the name of the MontaVista Software, Inc. nor the names of its
  20. * contributors may be used to endorse or promote products derived from this
  21. * software without specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  24. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  27. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  30. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  31. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  32. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  33. * THE POSSIBILITY OF SUCH DAMAGE.
  34. */
  35. #include <config.h>
  36. #include <sys/types.h>
  37. #include <sys/uio.h>
  38. #include <sys/socket.h>
  39. #include <sys/un.h>
  40. #include <netinet/in.h>
  41. #include <arpa/inet.h>
  42. #include <unistd.h>
  43. #include <fcntl.h>
  44. #include <stdlib.h>
  45. #include <stdio.h>
  46. #include <limits.h>
  47. #include <errno.h>
  48. #include <string.h>
  49. #include <assert.h>
  50. #include <corosync/corotypes.h>
  51. #include <qb/qbipc_common.h>
  52. #include <corosync/cfg.h>
  53. #include <qb/qblist.h>
  54. #include <corosync/mar_gen.h>
  55. #include <corosync/totem/totemip.h>
  56. #include <corosync/totem/totem.h>
  57. #include <corosync/ipc_cfg.h>
  58. #include <corosync/logsys.h>
  59. #include <corosync/coroapi.h>
  60. #include <corosync/icmap.h>
  61. #include <corosync/corodefs.h>
  62. #include "totemconfig.h"
  63. #include "service.h"
  64. #include "main.h"
  65. LOGSYS_DECLARE_SUBSYS ("CFG");
  66. enum cfg_message_req_types {
  67. MESSAGE_REQ_EXEC_CFG_RINGREENABLE = 0,
  68. MESSAGE_REQ_EXEC_CFG_KILLNODE = 1,
  69. MESSAGE_REQ_EXEC_CFG_SHUTDOWN = 2,
  70. MESSAGE_REQ_EXEC_CFG_RELOAD_CONFIG = 3
  71. };
  72. #define DEFAULT_SHUTDOWN_TIMEOUT 5
  73. static struct qb_list_head trackers_list;
  74. /*
  75. * Variables controlling a requested shutdown
  76. */
  77. static corosync_timer_handle_t shutdown_timer;
  78. static struct cfg_info *shutdown_con;
  79. static uint32_t shutdown_flags;
  80. static int shutdown_yes;
  81. static int shutdown_no;
  82. static int shutdown_expected;
  83. struct cfg_info
  84. {
  85. struct qb_list_head list;
  86. void *conn;
  87. void *tracker_conn;
  88. enum {SHUTDOWN_REPLY_UNKNOWN, SHUTDOWN_REPLY_YES, SHUTDOWN_REPLY_NO} shutdown_reply;
  89. };
  90. static void cfg_confchg_fn (
  91. enum totem_configuration_type configuration_type,
  92. const unsigned int *member_list, size_t member_list_entries,
  93. const unsigned int *left_list, size_t left_list_entries,
  94. const unsigned int *joined_list, size_t joined_list_entries,
  95. const struct memb_ring_id *ring_id);
  96. static char *cfg_exec_init_fn (struct corosync_api_v1 *corosync_api_v1);
  97. static struct corosync_api_v1 *api;
  98. static int cfg_lib_init_fn (void *conn);
  99. static int cfg_lib_exit_fn (void *conn);
  100. static void message_handler_req_exec_cfg_ringreenable (
  101. const void *message,
  102. unsigned int nodeid);
  103. static void message_handler_req_exec_cfg_killnode (
  104. const void *message,
  105. unsigned int nodeid);
  106. static void message_handler_req_exec_cfg_shutdown (
  107. const void *message,
  108. unsigned int nodeid);
  109. static void message_handler_req_exec_cfg_reload_config (
  110. const void *message,
  111. unsigned int nodeid);
  112. static void exec_cfg_killnode_endian_convert (void *msg);
  113. static void message_handler_req_lib_cfg_ringstatusget (
  114. void *conn,
  115. const void *msg);
  116. static void message_handler_req_lib_cfg_ringreenable (
  117. void *conn,
  118. const void *msg);
  119. static void message_handler_req_lib_cfg_killnode (
  120. void *conn,
  121. const void *msg);
  122. static void message_handler_req_lib_cfg_tryshutdown (
  123. void *conn,
  124. const void *msg);
  125. static void message_handler_req_lib_cfg_replytoshutdown (
  126. void *conn,
  127. const void *msg);
  128. static void message_handler_req_lib_cfg_get_node_addrs (
  129. void *conn,
  130. const void *msg);
  131. static void message_handler_req_lib_cfg_local_get (
  132. void *conn,
  133. const void *msg);
  134. static void message_handler_req_lib_cfg_reload_config (
  135. void *conn,
  136. const void *msg);
  137. static void message_handler_req_lib_cfg_reopen_log_files (
  138. void *conn,
  139. const void *msg);
  140. /*
  141. * Service Handler Definition
  142. */
  143. static struct corosync_lib_handler cfg_lib_engine[] =
  144. {
  145. { /* 0 */
  146. .lib_handler_fn = message_handler_req_lib_cfg_ringstatusget,
  147. .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
  148. },
  149. { /* 1 */
  150. .lib_handler_fn = message_handler_req_lib_cfg_ringreenable,
  151. .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
  152. },
  153. { /* 2 */
  154. .lib_handler_fn = message_handler_req_lib_cfg_killnode,
  155. .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
  156. },
  157. { /* 3 */
  158. .lib_handler_fn = message_handler_req_lib_cfg_tryshutdown,
  159. .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
  160. },
  161. { /* 4 */
  162. .lib_handler_fn = message_handler_req_lib_cfg_replytoshutdown,
  163. .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
  164. },
  165. { /* 5 */
  166. .lib_handler_fn = message_handler_req_lib_cfg_get_node_addrs,
  167. .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED
  168. },
  169. { /* 6 */
  170. .lib_handler_fn = message_handler_req_lib_cfg_local_get,
  171. .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED
  172. },
  173. { /* 7 */
  174. .lib_handler_fn = message_handler_req_lib_cfg_reload_config,
  175. .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
  176. },
  177. { /* 8 */
  178. .lib_handler_fn = message_handler_req_lib_cfg_reopen_log_files,
  179. .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED
  180. }
  181. };
  182. static struct corosync_exec_handler cfg_exec_engine[] =
  183. {
  184. { /* 0 */
  185. .exec_handler_fn = message_handler_req_exec_cfg_ringreenable,
  186. },
  187. { /* 1 */
  188. .exec_handler_fn = message_handler_req_exec_cfg_killnode,
  189. .exec_endian_convert_fn = exec_cfg_killnode_endian_convert
  190. },
  191. { /* 2 */
  192. .exec_handler_fn = message_handler_req_exec_cfg_shutdown,
  193. },
  194. { /* 3 */
  195. .exec_handler_fn = message_handler_req_exec_cfg_reload_config,
  196. }
  197. };
  198. /*
  199. * Exports the interface for the service
  200. */
  201. struct corosync_service_engine cfg_service_engine = {
  202. .name = "corosync configuration service",
  203. .id = CFG_SERVICE,
  204. .priority = 1,
  205. .private_data_size = sizeof(struct cfg_info),
  206. .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED,
  207. .allow_inquorate = CS_LIB_ALLOW_INQUORATE,
  208. .lib_init_fn = cfg_lib_init_fn,
  209. .lib_exit_fn = cfg_lib_exit_fn,
  210. .lib_engine = cfg_lib_engine,
  211. .lib_engine_count = sizeof (cfg_lib_engine) / sizeof (struct corosync_lib_handler),
  212. .exec_init_fn = cfg_exec_init_fn,
  213. .exec_engine = cfg_exec_engine,
  214. .exec_engine_count = sizeof (cfg_exec_engine) / sizeof (struct corosync_exec_handler),
  215. .confchg_fn = cfg_confchg_fn
  216. };
  217. struct corosync_service_engine *cfg_get_service_engine_ver0 (void)
  218. {
  219. return (&cfg_service_engine);
  220. }
  221. struct req_exec_cfg_ringreenable {
  222. struct qb_ipc_request_header header __attribute__((aligned(8)));
  223. mar_message_source_t source __attribute__((aligned(8)));
  224. };
  225. struct req_exec_cfg_reload_config {
  226. struct qb_ipc_request_header header __attribute__((aligned(8)));
  227. mar_message_source_t source __attribute__((aligned(8)));
  228. };
  229. struct req_exec_cfg_killnode {
  230. struct qb_ipc_request_header header __attribute__((aligned(8)));
  231. mar_uint32_t nodeid __attribute__((aligned(8)));
  232. mar_name_t reason __attribute__((aligned(8)));
  233. };
  234. struct req_exec_cfg_shutdown {
  235. struct qb_ipc_request_header header __attribute__((aligned(8)));
  236. };
  237. /* IMPL */
  238. static char *cfg_exec_init_fn (
  239. struct corosync_api_v1 *corosync_api_v1)
  240. {
  241. api = corosync_api_v1;
  242. qb_list_init(&trackers_list);
  243. return (NULL);
  244. }
  245. static void cfg_confchg_fn (
  246. enum totem_configuration_type configuration_type,
  247. const unsigned int *member_list, size_t member_list_entries,
  248. const unsigned int *left_list, size_t left_list_entries,
  249. const unsigned int *joined_list, size_t joined_list_entries,
  250. const struct memb_ring_id *ring_id)
  251. {
  252. }
  253. /*
  254. * Tell other nodes we are shutting down
  255. */
  256. static int send_shutdown(void)
  257. {
  258. struct req_exec_cfg_shutdown req_exec_cfg_shutdown;
  259. struct iovec iovec;
  260. ENTER();
  261. req_exec_cfg_shutdown.header.size =
  262. sizeof (struct req_exec_cfg_shutdown);
  263. req_exec_cfg_shutdown.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
  264. MESSAGE_REQ_EXEC_CFG_SHUTDOWN);
  265. iovec.iov_base = (char *)&req_exec_cfg_shutdown;
  266. iovec.iov_len = sizeof (struct req_exec_cfg_shutdown);
  267. assert (api->totem_mcast (&iovec, 1, TOTEM_SAFE) == 0);
  268. LEAVE();
  269. return 0;
  270. }
  271. static void send_test_shutdown(void *only_conn, void *exclude_conn, int status)
  272. {
  273. struct res_lib_cfg_testshutdown res_lib_cfg_testshutdown;
  274. struct qb_list_head *iter;
  275. ENTER();
  276. res_lib_cfg_testshutdown.header.size = sizeof(struct res_lib_cfg_testshutdown);
  277. res_lib_cfg_testshutdown.header.id = MESSAGE_RES_CFG_TESTSHUTDOWN;
  278. res_lib_cfg_testshutdown.header.error = status;
  279. res_lib_cfg_testshutdown.flags = shutdown_flags;
  280. if (only_conn) {
  281. TRACE1("sending testshutdown to only %p", only_conn);
  282. api->ipc_dispatch_send(only_conn, &res_lib_cfg_testshutdown,
  283. sizeof(res_lib_cfg_testshutdown));
  284. } else {
  285. qb_list_for_each(iter, &trackers_list) {
  286. struct cfg_info *ci = qb_list_entry(iter, struct cfg_info, list);
  287. if (ci->conn != exclude_conn) {
  288. TRACE1("sending testshutdown to %p", ci->tracker_conn);
  289. api->ipc_dispatch_send(ci->tracker_conn, &res_lib_cfg_testshutdown,
  290. sizeof(res_lib_cfg_testshutdown));
  291. }
  292. }
  293. }
  294. LEAVE();
  295. }
  296. static void check_shutdown_status(void)
  297. {
  298. ENTER();
  299. /*
  300. * Shutdown client might have gone away
  301. */
  302. if (!shutdown_con) {
  303. LEAVE();
  304. return;
  305. }
  306. /*
  307. * All replies safely gathered in ?
  308. */
  309. if (shutdown_yes + shutdown_no >= shutdown_expected) {
  310. struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
  311. api->timer_delete(shutdown_timer);
  312. if (shutdown_yes >= shutdown_expected ||
  313. shutdown_flags == CFG_SHUTDOWN_FLAG_REGARDLESS) {
  314. TRACE1("shutdown confirmed");
  315. res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
  316. res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
  317. res_lib_cfg_tryshutdown.header.error = CS_OK;
  318. /*
  319. * Tell originator that shutdown was confirmed
  320. */
  321. api->ipc_response_send(shutdown_con->conn, &res_lib_cfg_tryshutdown,
  322. sizeof(res_lib_cfg_tryshutdown));
  323. shutdown_con = NULL;
  324. /*
  325. * Tell other nodes we are going down
  326. */
  327. send_shutdown();
  328. }
  329. else {
  330. TRACE1("shutdown cancelled");
  331. res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
  332. res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
  333. res_lib_cfg_tryshutdown.header.error = CS_ERR_BUSY;
  334. /*
  335. * Tell originator that shutdown was cancelled
  336. */
  337. api->ipc_response_send(shutdown_con->conn, &res_lib_cfg_tryshutdown,
  338. sizeof(res_lib_cfg_tryshutdown));
  339. shutdown_con = NULL;
  340. }
  341. log_printf(LOGSYS_LEVEL_DEBUG, "shutdown decision is: (yes count: %d, no count: %d) flags=%x",
  342. shutdown_yes, shutdown_no, shutdown_flags);
  343. }
  344. LEAVE();
  345. }
  346. /*
  347. * Not all nodes responded to the shutdown (in time)
  348. */
  349. static void shutdown_timer_fn(void *arg)
  350. {
  351. ENTER();
  352. /*
  353. * Mark undecideds as "NO"
  354. */
  355. shutdown_no = shutdown_expected;
  356. check_shutdown_status();
  357. send_test_shutdown(NULL, NULL, CS_ERR_TIMEOUT);
  358. LEAVE();
  359. }
  360. static void remove_ci_from_shutdown(struct cfg_info *ci)
  361. {
  362. ENTER();
  363. /*
  364. * If the controlling shutdown process has quit, then cancel the
  365. * shutdown session
  366. */
  367. if (ci == shutdown_con) {
  368. shutdown_con = NULL;
  369. api->timer_delete(shutdown_timer);
  370. }
  371. if (!qb_list_empty(&ci->list)) {
  372. qb_list_del(&ci->list);
  373. qb_list_init(&ci->list);
  374. /*
  375. * Remove our option
  376. */
  377. if (shutdown_con) {
  378. if (ci->shutdown_reply == SHUTDOWN_REPLY_YES)
  379. shutdown_yes--;
  380. if (ci->shutdown_reply == SHUTDOWN_REPLY_NO)
  381. shutdown_no--;
  382. }
  383. /*
  384. * If we are leaving, then that's an implicit YES to shutdown
  385. */
  386. ci->shutdown_reply = SHUTDOWN_REPLY_YES;
  387. shutdown_yes++;
  388. check_shutdown_status();
  389. }
  390. LEAVE();
  391. }
  392. int cfg_lib_exit_fn (void *conn)
  393. {
  394. struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
  395. ENTER();
  396. remove_ci_from_shutdown(ci);
  397. LEAVE();
  398. return (0);
  399. }
  400. static int cfg_lib_init_fn (void *conn)
  401. {
  402. struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
  403. ENTER();
  404. qb_list_init(&ci->list);
  405. LEAVE();
  406. return (0);
  407. }
  408. /*
  409. * Executive message handlers
  410. */
  411. static void message_handler_req_exec_cfg_ringreenable (
  412. const void *message,
  413. unsigned int nodeid)
  414. {
  415. ENTER();
  416. LEAVE();
  417. }
  418. static void exec_cfg_killnode_endian_convert (void *msg)
  419. {
  420. struct req_exec_cfg_killnode *req_exec_cfg_killnode =
  421. (struct req_exec_cfg_killnode *)msg;
  422. ENTER();
  423. swab_mar_name_t(&req_exec_cfg_killnode->reason);
  424. LEAVE();
  425. }
  426. static void message_handler_req_exec_cfg_killnode (
  427. const void *message,
  428. unsigned int nodeid)
  429. {
  430. const struct req_exec_cfg_killnode *req_exec_cfg_killnode = message;
  431. cs_name_t reason;
  432. ENTER();
  433. log_printf(LOGSYS_LEVEL_DEBUG, "request to kill node " CS_PRI_NODE_ID " (us=" CS_PRI_NODE_ID ")",
  434. req_exec_cfg_killnode->nodeid, api->totem_nodeid_get());
  435. if (req_exec_cfg_killnode->nodeid == api->totem_nodeid_get()) {
  436. marshall_from_mar_name_t(&reason, &req_exec_cfg_killnode->reason);
  437. log_printf(LOGSYS_LEVEL_NOTICE, "Killed by node " CS_PRI_NODE_ID " : %s",
  438. nodeid, reason.value);
  439. corosync_fatal_error(COROSYNC_FATAL_ERROR_EXIT);
  440. }
  441. LEAVE();
  442. }
  443. /*
  444. * Self shutdown
  445. */
  446. static void message_handler_req_exec_cfg_shutdown (
  447. const void *message,
  448. unsigned int nodeid)
  449. {
  450. ENTER();
  451. log_printf(LOGSYS_LEVEL_NOTICE, "Node " CS_PRI_NODE_ID " was shut down by sysadmin", nodeid);
  452. if (nodeid == api->totem_nodeid_get()) {
  453. api->shutdown_request();
  454. }
  455. LEAVE();
  456. }
  457. /* strcmp replacement that can handle NULLs */
  458. static int nullcheck_strcmp(const char* left, const char *right)
  459. {
  460. if (!left && right)
  461. return -1;
  462. if (left && !right)
  463. return 1;
  464. if (!left && !right)
  465. return 0;
  466. return strcmp(left, right);
  467. }
  468. /*
  469. * If a key has changed value in the new file, then warn the user and remove it from the temp_map
  470. */
  471. static void delete_and_notify_if_changed(icmap_map_t temp_map, const char *key_name)
  472. {
  473. if (!(icmap_key_value_eq(temp_map, key_name, icmap_get_global_map(), key_name))) {
  474. if (icmap_delete_r(temp_map, key_name) == CS_OK) {
  475. log_printf(LOGSYS_LEVEL_NOTICE, "Modified entry '%s' in corosync.conf cannot be changed at run-time", key_name);
  476. }
  477. }
  478. }
  479. /*
  480. * Remove any keys from the new config file that in the new corosync.conf but that
  481. * cannot be changed at run time. A log message will be issued for each
  482. * entry that the user wants to change but they cannot.
  483. *
  484. * Add more here as needed.
  485. */
  486. static void remove_ro_entries(icmap_map_t temp_map)
  487. {
  488. delete_and_notify_if_changed(temp_map, "totem.secauth");
  489. delete_and_notify_if_changed(temp_map, "totem.crypto_hash");
  490. delete_and_notify_if_changed(temp_map, "totem.crypto_cipher");
  491. delete_and_notify_if_changed(temp_map, "totem.keyfile");
  492. delete_and_notify_if_changed(temp_map, "totem.key");
  493. delete_and_notify_if_changed(temp_map, "totem.version");
  494. delete_and_notify_if_changed(temp_map, "totem.threads");
  495. delete_and_notify_if_changed(temp_map, "totem.ip_version");
  496. delete_and_notify_if_changed(temp_map, "totem.rrp_mode");
  497. delete_and_notify_if_changed(temp_map, "totem.netmtu");
  498. delete_and_notify_if_changed(temp_map, "totem.interface.ringnumber");
  499. delete_and_notify_if_changed(temp_map, "totem.interface.bindnetaddr");
  500. delete_and_notify_if_changed(temp_map, "totem.interface.mcastaddr");
  501. delete_and_notify_if_changed(temp_map, "totem.interface.broadcast");
  502. delete_and_notify_if_changed(temp_map, "totem.interface.mcastport");
  503. delete_and_notify_if_changed(temp_map, "totem.interface.ttl");
  504. delete_and_notify_if_changed(temp_map, "totem.vsftype");
  505. delete_and_notify_if_changed(temp_map, "totem.transport");
  506. delete_and_notify_if_changed(temp_map, "totem.cluster_name");
  507. delete_and_notify_if_changed(temp_map, "quorum.provider");
  508. delete_and_notify_if_changed(temp_map, "system.move_to_root_cgroup");
  509. delete_and_notify_if_changed(temp_map, "system.sched_rr");
  510. delete_and_notify_if_changed(temp_map, "system.priority");
  511. delete_and_notify_if_changed(temp_map, "system.qb_ipc_type");
  512. delete_and_notify_if_changed(temp_map, "system.state_dir");
  513. }
  514. /*
  515. * Remove entries that exist in the global map, but not in the temp_map, this will
  516. * cause delete notifications to be sent to any listeners.
  517. *
  518. * NOTE: This routine depends entirely on the keys returned by the iterators
  519. * being in alpha-sorted order.
  520. */
  521. static void remove_deleted_entries(icmap_map_t temp_map, const char *prefix)
  522. {
  523. icmap_iter_t old_iter;
  524. icmap_iter_t new_iter;
  525. const char *old_key, *new_key;
  526. int ret;
  527. old_iter = icmap_iter_init(prefix);
  528. new_iter = icmap_iter_init_r(temp_map, prefix);
  529. old_key = icmap_iter_next(old_iter, NULL, NULL);
  530. new_key = icmap_iter_next(new_iter, NULL, NULL);
  531. while (old_key || new_key) {
  532. ret = nullcheck_strcmp(old_key, new_key);
  533. if ((ret < 0 && old_key) || !new_key) {
  534. /*
  535. * new_key is greater, a line (or more) has been deleted
  536. * Continue until old is >= new
  537. */
  538. do {
  539. /* Remove it from icmap & send notifications */
  540. icmap_delete(old_key);
  541. old_key = icmap_iter_next(old_iter, NULL, NULL);
  542. ret = nullcheck_strcmp(old_key, new_key);
  543. } while (ret < 0 && old_key);
  544. }
  545. else if ((ret > 0 && new_key) || !old_key) {
  546. /*
  547. * old_key is greater, a line (or more) has been added
  548. * Continue until new is >= old
  549. *
  550. * we don't need to do anything special with this like tell
  551. * icmap. That will happen when we copy the values over
  552. */
  553. do {
  554. new_key = icmap_iter_next(new_iter, NULL, NULL);
  555. ret = nullcheck_strcmp(old_key, new_key);
  556. } while (ret > 0 && new_key);
  557. }
  558. if (ret == 0) {
  559. new_key = icmap_iter_next(new_iter, NULL, NULL);
  560. old_key = icmap_iter_next(old_iter, NULL, NULL);
  561. }
  562. }
  563. icmap_iter_finalize(new_iter);
  564. icmap_iter_finalize(old_iter);
  565. }
  566. /*
  567. * Reload configuration file
  568. */
  569. static void message_handler_req_exec_cfg_reload_config (
  570. const void *message,
  571. unsigned int nodeid)
  572. {
  573. const struct req_exec_cfg_reload_config *req_exec_cfg_reload_config = message;
  574. struct res_lib_cfg_reload_config res_lib_cfg_reload_config;
  575. struct totem_config new_config;
  576. icmap_map_t temp_map;
  577. const char *error_string;
  578. int res = CS_OK;
  579. ENTER();
  580. log_printf(LOGSYS_LEVEL_NOTICE, "Config reload requested by node " CS_PRI_NODE_ID, nodeid);
  581. icmap_set_uint8("config.totemconfig_reload_in_progress", 1);
  582. /*
  583. * Set up a new hashtable as a staging area.
  584. */
  585. if ((res = icmap_init_r(&temp_map)) != CS_OK) {
  586. log_printf(LOGSYS_LEVEL_ERROR, "Unable to create temporary icmap. config file reload cancelled\n");
  587. goto reload_fini_nomap;
  588. }
  589. /*
  590. * Load new config into the temporary map
  591. */
  592. res = coroparse_configparse(temp_map, &error_string);
  593. if (res == -1) {
  594. log_printf (LOGSYS_LEVEL_ERROR, "Unable to reload config file: %s", error_string);
  595. res = CS_ERR_INVALID_PARAM;
  596. goto reload_fini_nofree;
  597. }
  598. /* Signal start of the reload process */
  599. icmap_set_uint8("config.reload_in_progress", 1);
  600. /* Detect deleted entries and remove them from the main icmap hashtable */
  601. remove_deleted_entries(temp_map, "logging.");
  602. remove_deleted_entries(temp_map, "totem.");
  603. remove_deleted_entries(temp_map, "nodelist.");
  604. remove_deleted_entries(temp_map, "quorum.");
  605. remove_deleted_entries(temp_map, "uidgid.config.");
  606. remove_deleted_entries(temp_map, "nozzle.");
  607. /* Remove entries that cannot be changed */
  608. remove_ro_entries(temp_map);
  609. /* Take a copy of the current setup so we can check what has changed */
  610. memset(&new_config, 0, sizeof(new_config));
  611. new_config.orig_interfaces = malloc (sizeof (struct totem_interface) * INTERFACE_MAX);
  612. assert(new_config.orig_interfaces != NULL);
  613. totempg_get_config(&new_config);
  614. new_config.interfaces = malloc (sizeof (struct totem_interface) * INTERFACE_MAX);
  615. assert(new_config.interfaces != NULL);
  616. memset(new_config.interfaces, 0, sizeof (struct totem_interface) * INTERFACE_MAX);
  617. /* Calculate new node and interface definitions */
  618. if (totemconfig_configure_new_params(&new_config, temp_map, &error_string) == -1) {
  619. log_printf (LOGSYS_LEVEL_ERROR, "Cannot configure new interface definitions: %s\n", error_string);
  620. res = CS_ERR_INVALID_PARAM;
  621. goto reload_fini;
  622. }
  623. /* Read from temp_map into new_config */
  624. totem_volatile_config_read(&new_config, temp_map, NULL);
  625. /* Validate dynamic parameters */
  626. if (totem_volatile_config_validate(&new_config, temp_map, &error_string) == -1) {
  627. log_printf (LOGSYS_LEVEL_ERROR, "Configuration is not valid: %s\n", error_string);
  628. res = CS_ERR_INVALID_PARAM;
  629. goto reload_fini;
  630. }
  631. /*
  632. * Copy new keys into live config.
  633. */
  634. if ( (res = icmap_copy_map(icmap_get_global_map(), temp_map)) != CS_OK) {
  635. log_printf (LOGSYS_LEVEL_ERROR, "Error making new config live. cmap database may be inconsistent\n");
  636. /* Return res from icmap */
  637. goto reload_fini;
  638. }
  639. /* Copy into live system */
  640. totempg_put_config(&new_config);
  641. totemconfig_commit_new_params(&new_config, temp_map);
  642. reload_fini:
  643. /* All done - let clients know */
  644. icmap_set_int32("config.reload_status", res);
  645. icmap_set_uint8("config.totemconfig_reload_in_progress", 0);
  646. icmap_set_uint8("config.reload_in_progress", 0);
  647. /* Finished with the temporary storage */
  648. free(new_config.orig_interfaces);
  649. reload_fini_nofree:
  650. icmap_fini_r(temp_map);
  651. reload_fini_nomap:
  652. /* All done, return result to the caller if it was on this system */
  653. if (nodeid == api->totem_nodeid_get()) {
  654. res_lib_cfg_reload_config.header.size = sizeof(res_lib_cfg_reload_config);
  655. res_lib_cfg_reload_config.header.id = MESSAGE_RES_CFG_RELOAD_CONFIG;
  656. res_lib_cfg_reload_config.header.error = res;
  657. api->ipc_response_send(req_exec_cfg_reload_config->source.conn,
  658. &res_lib_cfg_reload_config,
  659. sizeof(res_lib_cfg_reload_config));
  660. api->ipc_refcnt_dec(req_exec_cfg_reload_config->source.conn);;
  661. }
  662. LEAVE();
  663. }
  664. /*
  665. * Library Interface Implementation
  666. */
  667. static void message_handler_req_lib_cfg_ringstatusget (
  668. void *conn,
  669. const void *msg)
  670. {
  671. struct res_lib_cfg_ringstatusget res_lib_cfg_ringstatusget;
  672. struct totem_ip_address interfaces[INTERFACE_MAX];
  673. unsigned int iface_count;
  674. char **status;
  675. const char *totem_ip_string;
  676. char ifname[CFG_INTERFACE_NAME_MAX_LEN];
  677. unsigned int iface_ids[INTERFACE_MAX];
  678. unsigned int i;
  679. cs_error_t res = CS_OK;
  680. ENTER();
  681. res_lib_cfg_ringstatusget.header.id = MESSAGE_RES_CFG_RINGSTATUSGET;
  682. res_lib_cfg_ringstatusget.header.size = sizeof (struct res_lib_cfg_ringstatusget);
  683. api->totem_ifaces_get (
  684. api->totem_nodeid_get(),
  685. iface_ids,
  686. interfaces,
  687. INTERFACE_MAX,
  688. &status,
  689. &iface_count);
  690. assert(iface_count <= CFG_MAX_INTERFACES);
  691. res_lib_cfg_ringstatusget.interface_count = iface_count;
  692. for (i = 0; i < iface_count; i++) {
  693. totem_ip_string
  694. = (const char *)api->totem_ip_print (&interfaces[i]);
  695. if (!totem_ip_string) {
  696. totem_ip_string="";
  697. }
  698. /* Allow for i/f number at the start */
  699. if (strlen(totem_ip_string) >= CFG_INTERFACE_NAME_MAX_LEN-3) {
  700. log_printf(LOGSYS_LEVEL_ERROR, "String representation of interface %u is too long", i);
  701. res = CS_ERR_NAME_TOO_LONG;
  702. goto send_response;
  703. }
  704. snprintf(ifname, sizeof(ifname), "%d %s", iface_ids[i], totem_ip_string);
  705. if (strlen(status[i]) >= CFG_INTERFACE_STATUS_MAX_LEN) {
  706. log_printf(LOGSYS_LEVEL_ERROR, "Status string for interface %u is too long", i);
  707. res = CS_ERR_NAME_TOO_LONG;
  708. goto send_response;
  709. }
  710. strcpy ((char *)&res_lib_cfg_ringstatusget.interface_status[i],
  711. status[i]);
  712. strcpy ((char *)&res_lib_cfg_ringstatusget.interface_name[i],
  713. ifname);
  714. }
  715. send_response:
  716. res_lib_cfg_ringstatusget.header.error = res;
  717. api->ipc_response_send (
  718. conn,
  719. &res_lib_cfg_ringstatusget,
  720. sizeof (struct res_lib_cfg_ringstatusget));
  721. LEAVE();
  722. }
  723. static void message_handler_req_lib_cfg_ringreenable (
  724. void *conn,
  725. const void *msg)
  726. {
  727. struct res_lib_cfg_ringreenable res_lib_cfg_ringreenable;
  728. ENTER();
  729. res_lib_cfg_ringreenable.header.id = MESSAGE_RES_CFG_RINGREENABLE;
  730. res_lib_cfg_ringreenable.header.size = sizeof (struct res_lib_cfg_ringreenable);
  731. res_lib_cfg_ringreenable.header.error = CS_ERR_NOT_SUPPORTED;
  732. api->ipc_response_send (
  733. conn, &res_lib_cfg_ringreenable,
  734. sizeof (struct res_lib_cfg_ringreenable));
  735. LEAVE();
  736. }
  737. static void message_handler_req_lib_cfg_killnode (
  738. void *conn,
  739. const void *msg)
  740. {
  741. const struct req_lib_cfg_killnode *req_lib_cfg_killnode = msg;
  742. struct res_lib_cfg_killnode res_lib_cfg_killnode;
  743. struct req_exec_cfg_killnode req_exec_cfg_killnode;
  744. struct iovec iovec;
  745. ENTER();
  746. req_exec_cfg_killnode.header.size =
  747. sizeof (struct req_exec_cfg_killnode);
  748. req_exec_cfg_killnode.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
  749. MESSAGE_REQ_EXEC_CFG_KILLNODE);
  750. req_exec_cfg_killnode.nodeid = req_lib_cfg_killnode->nodeid;
  751. marshall_to_mar_name_t(&req_exec_cfg_killnode.reason, &req_lib_cfg_killnode->reason);
  752. iovec.iov_base = (char *)&req_exec_cfg_killnode;
  753. iovec.iov_len = sizeof (struct req_exec_cfg_killnode);
  754. (void)api->totem_mcast (&iovec, 1, TOTEM_SAFE);
  755. res_lib_cfg_killnode.header.size = sizeof(struct res_lib_cfg_killnode);
  756. res_lib_cfg_killnode.header.id = MESSAGE_RES_CFG_KILLNODE;
  757. res_lib_cfg_killnode.header.error = CS_OK;
  758. api->ipc_response_send(conn, &res_lib_cfg_killnode,
  759. sizeof(res_lib_cfg_killnode));
  760. LEAVE();
  761. }
  762. static void message_handler_req_lib_cfg_tryshutdown (
  763. void *conn,
  764. const void *msg)
  765. {
  766. struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
  767. const struct req_lib_cfg_tryshutdown *req_lib_cfg_tryshutdown = msg;
  768. struct qb_list_head *iter;
  769. ENTER();
  770. if (req_lib_cfg_tryshutdown->flags == CFG_SHUTDOWN_FLAG_IMMEDIATE) {
  771. struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
  772. /*
  773. * Tell other nodes
  774. */
  775. send_shutdown();
  776. res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
  777. res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
  778. res_lib_cfg_tryshutdown.header.error = CS_OK;
  779. api->ipc_response_send(conn, &res_lib_cfg_tryshutdown,
  780. sizeof(res_lib_cfg_tryshutdown));
  781. LEAVE();
  782. return;
  783. }
  784. /*
  785. * Shutdown in progress, return an error
  786. */
  787. if (shutdown_con) {
  788. struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
  789. res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
  790. res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
  791. res_lib_cfg_tryshutdown.header.error = CS_ERR_EXIST;
  792. api->ipc_response_send(conn, &res_lib_cfg_tryshutdown,
  793. sizeof(res_lib_cfg_tryshutdown));
  794. LEAVE();
  795. return;
  796. }
  797. ci->conn = conn;
  798. shutdown_con = (struct cfg_info *)api->ipc_private_data_get (conn);
  799. shutdown_flags = req_lib_cfg_tryshutdown->flags;
  800. shutdown_yes = 0;
  801. shutdown_no = 0;
  802. /*
  803. * Count the number of listeners
  804. */
  805. shutdown_expected = 0;
  806. qb_list_for_each(iter, &trackers_list) {
  807. struct cfg_info *testci = qb_list_entry(iter, struct cfg_info, list);
  808. /*
  809. * It is assumed that we will allow shutdown
  810. */
  811. if (testci != ci) {
  812. testci->shutdown_reply = SHUTDOWN_REPLY_UNKNOWN;
  813. shutdown_expected++;
  814. }
  815. }
  816. /*
  817. * If no-one is listening for events then we can just go down now
  818. */
  819. if (shutdown_expected == 0) {
  820. struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
  821. res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
  822. res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
  823. res_lib_cfg_tryshutdown.header.error = CS_OK;
  824. /*
  825. * Tell originator that shutdown was confirmed
  826. */
  827. api->ipc_response_send(conn, &res_lib_cfg_tryshutdown,
  828. sizeof(res_lib_cfg_tryshutdown));
  829. send_shutdown();
  830. LEAVE();
  831. return;
  832. }
  833. else {
  834. unsigned int shutdown_timeout = DEFAULT_SHUTDOWN_TIMEOUT;
  835. /*
  836. * Look for a shutdown timeout in configuration map
  837. */
  838. icmap_get_uint32("cfg.shutdown_timeout", &shutdown_timeout);
  839. /*
  840. * Start the timer. If we don't get a full set of replies before this goes
  841. * off we'll cancel the shutdown
  842. */
  843. api->timer_add_duration((unsigned long long)shutdown_timeout*1000000000, NULL,
  844. shutdown_timer_fn, &shutdown_timer);
  845. /*
  846. * Tell the users we would like to shut down
  847. */
  848. send_test_shutdown(NULL, conn, CS_OK);
  849. }
  850. /*
  851. * We don't sent a reply to the caller here.
  852. * We send it when we know if we can shut down or not
  853. */
  854. LEAVE();
  855. }
  856. static void message_handler_req_lib_cfg_replytoshutdown (
  857. void *conn,
  858. const void *msg)
  859. {
  860. struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
  861. const struct req_lib_cfg_replytoshutdown *req_lib_cfg_replytoshutdown = msg;
  862. struct res_lib_cfg_replytoshutdown res_lib_cfg_replytoshutdown;
  863. int status = CS_OK;
  864. ENTER();
  865. if (!shutdown_con) {
  866. status = CS_ERR_ACCESS;
  867. goto exit_fn;
  868. }
  869. if (req_lib_cfg_replytoshutdown->response) {
  870. shutdown_yes++;
  871. ci->shutdown_reply = SHUTDOWN_REPLY_YES;
  872. }
  873. else {
  874. shutdown_no++;
  875. ci->shutdown_reply = SHUTDOWN_REPLY_NO;
  876. }
  877. check_shutdown_status();
  878. exit_fn:
  879. res_lib_cfg_replytoshutdown.header.error = status;
  880. res_lib_cfg_replytoshutdown.header.id = MESSAGE_RES_CFG_REPLYTOSHUTDOWN;
  881. res_lib_cfg_replytoshutdown.header.size = sizeof(res_lib_cfg_replytoshutdown);
  882. api->ipc_response_send(conn, &res_lib_cfg_replytoshutdown,
  883. sizeof(res_lib_cfg_replytoshutdown));
  884. LEAVE();
  885. }
  886. static void message_handler_req_lib_cfg_get_node_addrs (void *conn,
  887. const void *msg)
  888. {
  889. struct totem_ip_address node_ifs[INTERFACE_MAX];
  890. unsigned int iface_ids[INTERFACE_MAX];
  891. char buf[PIPE_BUF];
  892. char **status;
  893. unsigned int num_interfaces = 0;
  894. struct sockaddr_storage *ss;
  895. int ret = CS_OK;
  896. int i;
  897. int live_addrs = 0;
  898. const struct req_lib_cfg_get_node_addrs *req_lib_cfg_get_node_addrs = msg;
  899. struct res_lib_cfg_get_node_addrs *res_lib_cfg_get_node_addrs = (struct res_lib_cfg_get_node_addrs *)buf;
  900. unsigned int nodeid = req_lib_cfg_get_node_addrs->nodeid;
  901. char *addr_buf;
  902. if (nodeid == 0)
  903. nodeid = api->totem_nodeid_get();
  904. if (api->totem_ifaces_get(nodeid, iface_ids, node_ifs, INTERFACE_MAX, &status, &num_interfaces)) {
  905. ret = CS_ERR_EXIST;
  906. num_interfaces = 0;
  907. }
  908. res_lib_cfg_get_node_addrs->header.size = sizeof(struct res_lib_cfg_get_node_addrs) + (num_interfaces * TOTEMIP_ADDRLEN);
  909. res_lib_cfg_get_node_addrs->header.id = MESSAGE_RES_CFG_GET_NODE_ADDRS;
  910. res_lib_cfg_get_node_addrs->header.error = ret;
  911. if (num_interfaces) {
  912. res_lib_cfg_get_node_addrs->family = node_ifs[0].family;
  913. for (i = 0, addr_buf = (char *)res_lib_cfg_get_node_addrs->addrs;
  914. i < num_interfaces; i++) {
  915. ss = (struct sockaddr_storage *)&node_ifs[i].addr;
  916. if (ss->ss_family) {
  917. memcpy(addr_buf, node_ifs[i].addr, TOTEMIP_ADDRLEN);
  918. live_addrs++;
  919. addr_buf += TOTEMIP_ADDRLEN;
  920. }
  921. }
  922. res_lib_cfg_get_node_addrs->num_addrs = live_addrs;
  923. } else {
  924. res_lib_cfg_get_node_addrs->header.error = CS_ERR_NOT_EXIST;
  925. }
  926. api->ipc_response_send(conn, res_lib_cfg_get_node_addrs, res_lib_cfg_get_node_addrs->header.size);
  927. }
  928. static void message_handler_req_lib_cfg_local_get (void *conn, const void *msg)
  929. {
  930. struct res_lib_cfg_local_get res_lib_cfg_local_get;
  931. res_lib_cfg_local_get.header.size = sizeof(res_lib_cfg_local_get);
  932. res_lib_cfg_local_get.header.id = MESSAGE_RES_CFG_LOCAL_GET;
  933. res_lib_cfg_local_get.header.error = CS_OK;
  934. res_lib_cfg_local_get.local_nodeid = api->totem_nodeid_get ();
  935. api->ipc_response_send(conn, &res_lib_cfg_local_get,
  936. sizeof(res_lib_cfg_local_get));
  937. }
  938. static void message_handler_req_lib_cfg_reload_config (void *conn, const void *msg)
  939. {
  940. struct req_exec_cfg_reload_config req_exec_cfg_reload_config;
  941. struct iovec iovec;
  942. ENTER();
  943. req_exec_cfg_reload_config.header.size =
  944. sizeof (struct req_exec_cfg_reload_config);
  945. req_exec_cfg_reload_config.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
  946. MESSAGE_REQ_EXEC_CFG_RELOAD_CONFIG);
  947. api->ipc_source_set (&req_exec_cfg_reload_config.source, conn);
  948. api->ipc_refcnt_inc(conn);
  949. iovec.iov_base = (char *)&req_exec_cfg_reload_config;
  950. iovec.iov_len = sizeof (struct req_exec_cfg_reload_config);
  951. assert (api->totem_mcast (&iovec, 1, TOTEM_SAFE) == 0);
  952. LEAVE();
  953. }
  954. static void message_handler_req_lib_cfg_reopen_log_files (void *conn, const void *msg)
  955. {
  956. struct res_lib_cfg_reopen_log_files res_lib_cfg_reopen_log_files;
  957. cs_error_t res;
  958. ENTER();
  959. log_printf(LOGSYS_LEVEL_DEBUG, "Reopening logging files\n");
  960. res = logsys_reopen_log_files();
  961. res_lib_cfg_reopen_log_files.header.size = sizeof(res_lib_cfg_reopen_log_files);
  962. res_lib_cfg_reopen_log_files.header.id = MESSAGE_RES_CFG_REOPEN_LOG_FILES;
  963. res_lib_cfg_reopen_log_files.header.error = res;
  964. api->ipc_response_send(conn,
  965. &res_lib_cfg_reopen_log_files,
  966. sizeof(res_lib_cfg_reopen_log_files));
  967. LEAVE();
  968. }