cfg.c 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  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_LIBRARY;
  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) == -1) {
  619. log_printf (LOGSYS_LEVEL_ERROR, "Cannot configure new interface definitons: %s\n", error_string);
  620. res = -1;
  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 = -1;
  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. res = -1;
  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_uint8("config.totemconfig_reload_in_progress", 0);
  645. icmap_set_uint8("config.reload_in_progress", 0);
  646. /* Finished with the temporary storage */
  647. free(new_config.orig_interfaces);
  648. reload_fini_nofree:
  649. icmap_fini_r(temp_map);
  650. reload_fini_nomap:
  651. /* All done, return result to the caller if it was on this system */
  652. if (nodeid == api->totem_nodeid_get()) {
  653. res_lib_cfg_reload_config.header.size = sizeof(res_lib_cfg_reload_config);
  654. res_lib_cfg_reload_config.header.id = MESSAGE_RES_CFG_RELOAD_CONFIG;
  655. res_lib_cfg_reload_config.header.error = res;
  656. api->ipc_response_send(req_exec_cfg_reload_config->source.conn,
  657. &res_lib_cfg_reload_config,
  658. sizeof(res_lib_cfg_reload_config));
  659. api->ipc_refcnt_dec(req_exec_cfg_reload_config->source.conn);;
  660. }
  661. LEAVE();
  662. }
  663. /*
  664. * Library Interface Implementation
  665. */
  666. static void message_handler_req_lib_cfg_ringstatusget (
  667. void *conn,
  668. const void *msg)
  669. {
  670. struct res_lib_cfg_ringstatusget res_lib_cfg_ringstatusget;
  671. struct totem_ip_address interfaces[INTERFACE_MAX];
  672. unsigned int iface_count;
  673. char **status;
  674. const char *totem_ip_string;
  675. char ifname[CFG_INTERFACE_NAME_MAX_LEN];
  676. unsigned int iface_ids[INTERFACE_MAX];
  677. unsigned int i;
  678. cs_error_t res = CS_OK;
  679. ENTER();
  680. res_lib_cfg_ringstatusget.header.id = MESSAGE_RES_CFG_RINGSTATUSGET;
  681. res_lib_cfg_ringstatusget.header.size = sizeof (struct res_lib_cfg_ringstatusget);
  682. api->totem_ifaces_get (
  683. api->totem_nodeid_get(),
  684. iface_ids,
  685. interfaces,
  686. INTERFACE_MAX,
  687. &status,
  688. &iface_count);
  689. assert(iface_count <= CFG_MAX_INTERFACES);
  690. res_lib_cfg_ringstatusget.interface_count = iface_count;
  691. for (i = 0; i < iface_count; i++) {
  692. totem_ip_string
  693. = (const char *)api->totem_ip_print (&interfaces[i]);
  694. if (!totem_ip_string) {
  695. totem_ip_string="";
  696. }
  697. /* Allow for i/f number at the start */
  698. if (strlen(totem_ip_string) >= CFG_INTERFACE_NAME_MAX_LEN-3) {
  699. log_printf(LOGSYS_LEVEL_ERROR, "String representation of interface %u is too long", i);
  700. res = CS_ERR_NAME_TOO_LONG;
  701. goto send_response;
  702. }
  703. snprintf(ifname, sizeof(ifname), "%d %s", iface_ids[i], totem_ip_string);
  704. if (strlen(status[i]) >= CFG_INTERFACE_STATUS_MAX_LEN) {
  705. log_printf(LOGSYS_LEVEL_ERROR, "Status string for interface %u is too long", i);
  706. res = CS_ERR_NAME_TOO_LONG;
  707. goto send_response;
  708. }
  709. strcpy ((char *)&res_lib_cfg_ringstatusget.interface_status[i],
  710. status[i]);
  711. strcpy ((char *)&res_lib_cfg_ringstatusget.interface_name[i],
  712. ifname);
  713. }
  714. send_response:
  715. res_lib_cfg_ringstatusget.header.error = res;
  716. api->ipc_response_send (
  717. conn,
  718. &res_lib_cfg_ringstatusget,
  719. sizeof (struct res_lib_cfg_ringstatusget));
  720. LEAVE();
  721. }
  722. static void message_handler_req_lib_cfg_ringreenable (
  723. void *conn,
  724. const void *msg)
  725. {
  726. struct res_lib_cfg_ringreenable res_lib_cfg_ringreenable;
  727. ENTER();
  728. res_lib_cfg_ringreenable.header.id = MESSAGE_RES_CFG_RINGREENABLE;
  729. res_lib_cfg_ringreenable.header.size = sizeof (struct res_lib_cfg_ringreenable);
  730. res_lib_cfg_ringreenable.header.error = CS_ERR_NOT_SUPPORTED;
  731. api->ipc_response_send (
  732. conn, &res_lib_cfg_ringreenable,
  733. sizeof (struct res_lib_cfg_ringreenable));
  734. LEAVE();
  735. }
  736. static void message_handler_req_lib_cfg_killnode (
  737. void *conn,
  738. const void *msg)
  739. {
  740. const struct req_lib_cfg_killnode *req_lib_cfg_killnode = msg;
  741. struct res_lib_cfg_killnode res_lib_cfg_killnode;
  742. struct req_exec_cfg_killnode req_exec_cfg_killnode;
  743. struct iovec iovec;
  744. ENTER();
  745. req_exec_cfg_killnode.header.size =
  746. sizeof (struct req_exec_cfg_killnode);
  747. req_exec_cfg_killnode.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
  748. MESSAGE_REQ_EXEC_CFG_KILLNODE);
  749. req_exec_cfg_killnode.nodeid = req_lib_cfg_killnode->nodeid;
  750. marshall_to_mar_name_t(&req_exec_cfg_killnode.reason, &req_lib_cfg_killnode->reason);
  751. iovec.iov_base = (char *)&req_exec_cfg_killnode;
  752. iovec.iov_len = sizeof (struct req_exec_cfg_killnode);
  753. (void)api->totem_mcast (&iovec, 1, TOTEM_SAFE);
  754. res_lib_cfg_killnode.header.size = sizeof(struct res_lib_cfg_killnode);
  755. res_lib_cfg_killnode.header.id = MESSAGE_RES_CFG_KILLNODE;
  756. res_lib_cfg_killnode.header.error = CS_OK;
  757. api->ipc_response_send(conn, &res_lib_cfg_killnode,
  758. sizeof(res_lib_cfg_killnode));
  759. LEAVE();
  760. }
  761. static void message_handler_req_lib_cfg_tryshutdown (
  762. void *conn,
  763. const void *msg)
  764. {
  765. struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
  766. const struct req_lib_cfg_tryshutdown *req_lib_cfg_tryshutdown = msg;
  767. struct qb_list_head *iter;
  768. ENTER();
  769. if (req_lib_cfg_tryshutdown->flags == CFG_SHUTDOWN_FLAG_IMMEDIATE) {
  770. struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
  771. /*
  772. * Tell other nodes
  773. */
  774. send_shutdown();
  775. res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
  776. res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
  777. res_lib_cfg_tryshutdown.header.error = CS_OK;
  778. api->ipc_response_send(conn, &res_lib_cfg_tryshutdown,
  779. sizeof(res_lib_cfg_tryshutdown));
  780. LEAVE();
  781. return;
  782. }
  783. /*
  784. * Shutdown in progress, return an error
  785. */
  786. if (shutdown_con) {
  787. struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
  788. res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
  789. res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
  790. res_lib_cfg_tryshutdown.header.error = CS_ERR_EXIST;
  791. api->ipc_response_send(conn, &res_lib_cfg_tryshutdown,
  792. sizeof(res_lib_cfg_tryshutdown));
  793. LEAVE();
  794. return;
  795. }
  796. ci->conn = conn;
  797. shutdown_con = (struct cfg_info *)api->ipc_private_data_get (conn);
  798. shutdown_flags = req_lib_cfg_tryshutdown->flags;
  799. shutdown_yes = 0;
  800. shutdown_no = 0;
  801. /*
  802. * Count the number of listeners
  803. */
  804. shutdown_expected = 0;
  805. qb_list_for_each(iter, &trackers_list) {
  806. struct cfg_info *testci = qb_list_entry(iter, struct cfg_info, list);
  807. /*
  808. * It is assumed that we will allow shutdown
  809. */
  810. if (testci != ci) {
  811. testci->shutdown_reply = SHUTDOWN_REPLY_UNKNOWN;
  812. shutdown_expected++;
  813. }
  814. }
  815. /*
  816. * If no-one is listening for events then we can just go down now
  817. */
  818. if (shutdown_expected == 0) {
  819. struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
  820. res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
  821. res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
  822. res_lib_cfg_tryshutdown.header.error = CS_OK;
  823. /*
  824. * Tell originator that shutdown was confirmed
  825. */
  826. api->ipc_response_send(conn, &res_lib_cfg_tryshutdown,
  827. sizeof(res_lib_cfg_tryshutdown));
  828. send_shutdown();
  829. LEAVE();
  830. return;
  831. }
  832. else {
  833. unsigned int shutdown_timeout = DEFAULT_SHUTDOWN_TIMEOUT;
  834. /*
  835. * Look for a shutdown timeout in configuration map
  836. */
  837. icmap_get_uint32("cfg.shutdown_timeout", &shutdown_timeout);
  838. /*
  839. * Start the timer. If we don't get a full set of replies before this goes
  840. * off we'll cancel the shutdown
  841. */
  842. api->timer_add_duration((unsigned long long)shutdown_timeout*1000000000, NULL,
  843. shutdown_timer_fn, &shutdown_timer);
  844. /*
  845. * Tell the users we would like to shut down
  846. */
  847. send_test_shutdown(NULL, conn, CS_OK);
  848. }
  849. /*
  850. * We don't sent a reply to the caller here.
  851. * We send it when we know if we can shut down or not
  852. */
  853. LEAVE();
  854. }
  855. static void message_handler_req_lib_cfg_replytoshutdown (
  856. void *conn,
  857. const void *msg)
  858. {
  859. struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
  860. const struct req_lib_cfg_replytoshutdown *req_lib_cfg_replytoshutdown = msg;
  861. struct res_lib_cfg_replytoshutdown res_lib_cfg_replytoshutdown;
  862. int status = CS_OK;
  863. ENTER();
  864. if (!shutdown_con) {
  865. status = CS_ERR_ACCESS;
  866. goto exit_fn;
  867. }
  868. if (req_lib_cfg_replytoshutdown->response) {
  869. shutdown_yes++;
  870. ci->shutdown_reply = SHUTDOWN_REPLY_YES;
  871. }
  872. else {
  873. shutdown_no++;
  874. ci->shutdown_reply = SHUTDOWN_REPLY_NO;
  875. }
  876. check_shutdown_status();
  877. exit_fn:
  878. res_lib_cfg_replytoshutdown.header.error = status;
  879. res_lib_cfg_replytoshutdown.header.id = MESSAGE_RES_CFG_REPLYTOSHUTDOWN;
  880. res_lib_cfg_replytoshutdown.header.size = sizeof(res_lib_cfg_replytoshutdown);
  881. api->ipc_response_send(conn, &res_lib_cfg_replytoshutdown,
  882. sizeof(res_lib_cfg_replytoshutdown));
  883. LEAVE();
  884. }
  885. static void message_handler_req_lib_cfg_get_node_addrs (void *conn,
  886. const void *msg)
  887. {
  888. struct totem_ip_address node_ifs[INTERFACE_MAX];
  889. unsigned int iface_ids[INTERFACE_MAX];
  890. char buf[PIPE_BUF];
  891. char **status;
  892. unsigned int num_interfaces = 0;
  893. struct sockaddr_storage *ss;
  894. int ret = CS_OK;
  895. int i;
  896. int live_addrs = 0;
  897. const struct req_lib_cfg_get_node_addrs *req_lib_cfg_get_node_addrs = msg;
  898. struct res_lib_cfg_get_node_addrs *res_lib_cfg_get_node_addrs = (struct res_lib_cfg_get_node_addrs *)buf;
  899. unsigned int nodeid = req_lib_cfg_get_node_addrs->nodeid;
  900. char *addr_buf;
  901. if (nodeid == 0)
  902. nodeid = api->totem_nodeid_get();
  903. if (api->totem_ifaces_get(nodeid, iface_ids, node_ifs, INTERFACE_MAX, &status, &num_interfaces)) {
  904. ret = CS_ERR_EXIST;
  905. num_interfaces = 0;
  906. }
  907. res_lib_cfg_get_node_addrs->header.size = sizeof(struct res_lib_cfg_get_node_addrs) + (num_interfaces * TOTEMIP_ADDRLEN);
  908. res_lib_cfg_get_node_addrs->header.id = MESSAGE_RES_CFG_GET_NODE_ADDRS;
  909. res_lib_cfg_get_node_addrs->header.error = ret;
  910. if (num_interfaces) {
  911. res_lib_cfg_get_node_addrs->family = node_ifs[0].family;
  912. for (i = 0, addr_buf = (char *)res_lib_cfg_get_node_addrs->addrs;
  913. i < num_interfaces; i++) {
  914. ss = (struct sockaddr_storage *)&node_ifs[i].addr;
  915. if (ss->ss_family) {
  916. memcpy(addr_buf, node_ifs[i].addr, TOTEMIP_ADDRLEN);
  917. live_addrs++;
  918. addr_buf += TOTEMIP_ADDRLEN;
  919. }
  920. }
  921. res_lib_cfg_get_node_addrs->num_addrs = live_addrs;
  922. } else {
  923. res_lib_cfg_get_node_addrs->header.error = CS_ERR_NOT_EXIST;
  924. }
  925. api->ipc_response_send(conn, res_lib_cfg_get_node_addrs, res_lib_cfg_get_node_addrs->header.size);
  926. }
  927. static void message_handler_req_lib_cfg_local_get (void *conn, const void *msg)
  928. {
  929. struct res_lib_cfg_local_get res_lib_cfg_local_get;
  930. res_lib_cfg_local_get.header.size = sizeof(res_lib_cfg_local_get);
  931. res_lib_cfg_local_get.header.id = MESSAGE_RES_CFG_LOCAL_GET;
  932. res_lib_cfg_local_get.header.error = CS_OK;
  933. res_lib_cfg_local_get.local_nodeid = api->totem_nodeid_get ();
  934. api->ipc_response_send(conn, &res_lib_cfg_local_get,
  935. sizeof(res_lib_cfg_local_get));
  936. }
  937. static void message_handler_req_lib_cfg_reload_config (void *conn, const void *msg)
  938. {
  939. struct req_exec_cfg_reload_config req_exec_cfg_reload_config;
  940. struct iovec iovec;
  941. ENTER();
  942. req_exec_cfg_reload_config.header.size =
  943. sizeof (struct req_exec_cfg_reload_config);
  944. req_exec_cfg_reload_config.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
  945. MESSAGE_REQ_EXEC_CFG_RELOAD_CONFIG);
  946. api->ipc_source_set (&req_exec_cfg_reload_config.source, conn);
  947. api->ipc_refcnt_inc(conn);
  948. iovec.iov_base = (char *)&req_exec_cfg_reload_config;
  949. iovec.iov_len = sizeof (struct req_exec_cfg_reload_config);
  950. assert (api->totem_mcast (&iovec, 1, TOTEM_SAFE) == 0);
  951. LEAVE();
  952. }
  953. static void message_handler_req_lib_cfg_reopen_log_files (void *conn, const void *msg)
  954. {
  955. struct res_lib_cfg_reopen_log_files res_lib_cfg_reopen_log_files;
  956. cs_error_t res;
  957. ENTER();
  958. log_printf(LOGSYS_LEVEL_DEBUG, "Reopening logging files\n");
  959. res = logsys_reopen_log_files();
  960. res_lib_cfg_reopen_log_files.header.size = sizeof(res_lib_cfg_reopen_log_files);
  961. res_lib_cfg_reopen_log_files.header.id = MESSAGE_RES_CFG_REOPEN_LOG_FILES;
  962. res_lib_cfg_reopen_log_files.header.error = res;
  963. api->ipc_response_send(conn,
  964. &res_lib_cfg_reopen_log_files,
  965. sizeof(res_lib_cfg_reopen_log_files));
  966. LEAVE();
  967. }