main.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. /*
  2. * Copyright (c) 2002-2006 MontaVista Software, Inc.
  3. * Copyright (c) 2006 Red Hat, Inc.
  4. * Copyright (c) 2006 Sun Microsystems, Inc.
  5. *
  6. * All rights reserved.
  7. *
  8. * Author: Steven Dake (sdake@mvista.com)
  9. *
  10. * This software licensed under BSD license, the text of which follows:
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions are met:
  14. *
  15. * - Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * - Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * - Neither the name of the MontaVista Software, Inc. nor the names of its
  21. * contributors may be used to endorse or promote products derived from this
  22. * software without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  28. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  29. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  30. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  31. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  32. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  33. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  34. * THE POSSIBILITY OF SUCH DAMAGE.
  35. */
  36. #include <pthread.h>
  37. #include <assert.h>
  38. #include <pwd.h>
  39. #include <grp.h>
  40. #include <sys/types.h>
  41. #include <sys/poll.h>
  42. #include <sys/uio.h>
  43. #include <sys/mman.h>
  44. #include <sys/socket.h>
  45. #include <sys/un.h>
  46. #include <sys/time.h>
  47. #include <sys/resource.h>
  48. #include <netinet/in.h>
  49. #include <arpa/inet.h>
  50. #include <unistd.h>
  51. #include <fcntl.h>
  52. #include <stdlib.h>
  53. #include <stdio.h>
  54. #include <errno.h>
  55. #include <signal.h>
  56. #include <sched.h>
  57. #include <time.h>
  58. #include "swab.h"
  59. #include "../include/saAis.h"
  60. #include "../include/list.h"
  61. #include "../include/queue.h"
  62. #include "../lcr/lcr_ifact.h"
  63. #include "poll.h"
  64. #include "totempg.h"
  65. #include "totemsrp.h"
  66. #include "mempool.h"
  67. #include "mainconfig.h"
  68. #include "totemconfig.h"
  69. #include "main.h"
  70. #include "service.h"
  71. #include "sync.h"
  72. #include "swab.h"
  73. #include "objdb.h"
  74. #include "config.h"
  75. #include "ipc.h"
  76. #include "timer.h"
  77. #include "logsys.h"
  78. #include "util.h"
  79. #include "flow.h"
  80. #include "version.h"
  81. LOGSYS_DECLARE_SYSTEM ("openais",
  82. LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_DISPLAY_DEBUG | LOG_MODE_BUFFER_BEFORE_CONFIG,
  83. NULL,
  84. LOG_DAEMON);
  85. LOGSYS_DECLARE_SUBSYS ("MAIN", LOG_INFO);
  86. #define SERVER_BACKLOG 5
  87. static int ais_uid = 0;
  88. static int gid_valid = 0;
  89. static unsigned int service_count = 32;
  90. static pthread_mutex_t serialize_mutex = PTHREAD_MUTEX_INITIALIZER;
  91. static struct totem_logging_configuration totem_logging_configuration;
  92. static char delivery_data[MESSAGE_SIZE_MAX];
  93. SaClmClusterNodeT *(*main_clm_get_by_nodeid) (unsigned int node_id);
  94. static void sigusr2_handler (int num)
  95. {
  96. int i;
  97. for (i = 0; ais_service[i]; i++) {
  98. if (ais_service[i]->exec_dump_fn) {
  99. ais_service[i]->exec_dump_fn ();
  100. }
  101. }
  102. }
  103. static void sigsegv_handler (int num)
  104. {
  105. signal (SIGSEGV, SIG_DFL);
  106. logsys_flush ();
  107. raise (SIGSEGV);
  108. }
  109. static void sigabrt_handler (int num)
  110. {
  111. signal (SIGABRT, SIG_DFL);
  112. logsys_flush ();
  113. raise (SIGABRT);
  114. }
  115. #define LOCALHOST_IP inet_addr("127.0.0.1")
  116. totempg_groups_handle openais_group_handle;
  117. struct totempg_group openais_group = {
  118. .group = "a",
  119. .group_len = 1
  120. };
  121. void sigintr_handler (int signum)
  122. {
  123. #ifdef DEBUG_MEMPOOL
  124. int stats_inuse[MEMPOOL_GROUP_SIZE];
  125. int stats_avail[MEMPOOL_GROUP_SIZE];
  126. int stats_memoryused[MEMPOOL_GROUP_SIZE];
  127. int i;
  128. mempool_getstats (stats_inuse, stats_avail, stats_memoryused);
  129. log_printf (LOG_LEVEL_DEBUG, "Memory pools:\n");
  130. for (i = 0; i < MEMPOOL_GROUP_SIZE; i++) {
  131. log_printf (LOG_LEVEL_DEBUG, "order %d size %d inuse %d avail %d memory used %d\n",
  132. i, 1<<i, stats_inuse[i], stats_avail[i], stats_memoryused[i]);
  133. }
  134. #endif
  135. totempg_finalize ();
  136. openais_exit_error (AIS_DONE_EXIT);
  137. }
  138. static int pool_sizes[] = { 0, 0, 0, 0, 0, 4096, 0, 1, 0, /* 256 */
  139. 1024, 0, 1, 4096, 0, 0, 0, 0, /* 65536 */
  140. 1, 1, 1, 1, 1, 1, 1, 1, 1 };
  141. void serialize_mutex_lock (void)
  142. {
  143. pthread_mutex_lock (&serialize_mutex);
  144. }
  145. void serialize_mutex_unlock (void)
  146. {
  147. pthread_mutex_unlock (&serialize_mutex);
  148. }
  149. static void openais_sync_completed (void)
  150. {
  151. }
  152. static int openais_sync_callbacks_retrieve (int sync_id,
  153. struct sync_callbacks *callbacks)
  154. {
  155. unsigned int ais_service_index;
  156. unsigned int ais_services_found = 0;
  157. for (ais_service_index = 0;
  158. ais_service_index < SERVICE_HANDLER_MAXIMUM_COUNT;
  159. ais_service_index++) {
  160. if (ais_service[ais_service_index] != NULL) {
  161. if (ais_services_found == sync_id) {
  162. break;
  163. }
  164. ais_services_found += 1;
  165. }
  166. }
  167. if (ais_service_index == SERVICE_HANDLER_MAXIMUM_COUNT) {
  168. memset (callbacks, 0, sizeof (struct sync_callbacks));
  169. return (-1);
  170. }
  171. callbacks->name = ais_service[ais_service_index]->name;
  172. callbacks->sync_init = ais_service[ais_service_index]->sync_init;
  173. callbacks->sync_process = ais_service[ais_service_index]->sync_process;
  174. callbacks->sync_activate = ais_service[ais_service_index]->sync_activate;
  175. callbacks->sync_abort = ais_service[ais_service_index]->sync_abort;
  176. return (0);
  177. }
  178. static struct memb_ring_id aisexec_ring_id;
  179. static void confchg_fn (
  180. enum totem_configuration_type configuration_type,
  181. unsigned int *member_list, int member_list_entries,
  182. unsigned int *left_list, int left_list_entries,
  183. unsigned int *joined_list, int joined_list_entries,
  184. struct memb_ring_id *ring_id)
  185. {
  186. int i;
  187. memcpy (&aisexec_ring_id, ring_id, sizeof (struct memb_ring_id));
  188. /*
  189. * Call configuration change for all services
  190. */
  191. for (i = 0; i < service_count; i++) {
  192. if (ais_service[i] && ais_service[i]->confchg_fn) {
  193. ais_service[i]->confchg_fn (configuration_type,
  194. member_list, member_list_entries,
  195. left_list, left_list_entries,
  196. joined_list, joined_list_entries, ring_id);
  197. }
  198. }
  199. }
  200. static void aisexec_uid_determine (struct main_config *main_config)
  201. {
  202. struct passwd *passwd;
  203. passwd = getpwnam(main_config->user);
  204. if (passwd == 0) {
  205. log_printf (LOG_LEVEL_ERROR, "ERROR: The '%s' user is not found in /etc/passwd, please read the documentation.\n", main_config->user);
  206. openais_exit_error (AIS_DONE_UID_DETERMINE);
  207. }
  208. ais_uid = passwd->pw_uid;
  209. endpwent ();
  210. }
  211. static void aisexec_gid_determine (struct main_config *main_config)
  212. {
  213. struct group *group;
  214. group = getgrnam (main_config->group);
  215. if (group == 0) {
  216. log_printf (LOG_LEVEL_ERROR, "ERROR: The '%s' group is not found in /etc/group, please read the documentation.\n", group->gr_name);
  217. openais_exit_error (AIS_DONE_GID_DETERMINE);
  218. }
  219. gid_valid = group->gr_gid;
  220. endgrent ();
  221. }
  222. static void aisexec_priv_drop (void)
  223. {
  224. return;
  225. setuid (ais_uid);
  226. setegid (ais_uid);
  227. }
  228. static void aisexec_mempool_init (void)
  229. {
  230. int res;
  231. res = mempool_init (pool_sizes);
  232. if (res == ENOMEM) {
  233. log_printf (LOG_LEVEL_ERROR, "Couldn't allocate memory pools, not enough memory");
  234. openais_exit_error (AIS_DONE_MEMPOOL_INIT);
  235. }
  236. }
  237. static void aisexec_tty_detach (void)
  238. {
  239. /*
  240. * Disconnect from TTY if this is not a debug run
  241. */
  242. switch (fork ()) {
  243. case -1:
  244. openais_exit_error (AIS_DONE_FORK);
  245. break;
  246. case 0:
  247. /*
  248. * child which is disconnected, run this process
  249. */
  250. break;
  251. default:
  252. exit (0);
  253. break;
  254. }
  255. }
  256. static void aisexec_setscheduler (void)
  257. {
  258. #if ! defined(TS_CLASS) && (defined(OPENAIS_BSD) || defined(OPENAIS_LINUX) || defined(OPENAIS_SOLARIS))
  259. struct sched_param sched_param;
  260. int res;
  261. res = sched_get_priority_max (SCHED_RR);
  262. if (res != -1) {
  263. sched_param.sched_priority = 1;//res;
  264. res = sched_setscheduler (0, SCHED_RR, &sched_param);
  265. if (res == -1) {
  266. log_printf (LOG_LEVEL_WARNING, "Could not set SCHED_RR at priority %d: %s\n",
  267. sched_param.sched_priority, strerror (errno));
  268. }
  269. } else
  270. log_printf (LOG_LEVEL_WARNING, "Could not get maximum scheduler priority: %s\n", strerror (errno));
  271. #else
  272. log_printf(LOG_LEVEL_WARNING, "Scheduler priority left to default value (no OS support)\n");
  273. #endif
  274. }
  275. static void aisexec_mlockall (void)
  276. {
  277. #if !defined(OPENAIS_BSD)
  278. int res;
  279. #endif
  280. struct rlimit rlimit;
  281. rlimit.rlim_cur = RLIM_INFINITY;
  282. rlimit.rlim_max = RLIM_INFINITY;
  283. #ifndef OPENAIS_SOLARIS
  284. setrlimit (RLIMIT_MEMLOCK, &rlimit);
  285. #else
  286. setrlimit (RLIMIT_VMEM, &rlimit);
  287. #endif
  288. #if defined(OPENAIS_BSD)
  289. /* under FreeBSD a process with locked page cannot call dlopen
  290. * code disabled until FreeBSD bug i386/93396 was solved
  291. */
  292. log_printf (LOG_LEVEL_WARNING, "Could not lock memory of service to avoid page faults\n");
  293. #else
  294. res = mlockall (MCL_CURRENT | MCL_FUTURE);
  295. if (res == -1) {
  296. log_printf (LOG_LEVEL_WARNING, "Could not lock memory of service to avoid page faults: %s\n", strerror (errno));
  297. };
  298. #endif
  299. }
  300. static void deliver_fn (
  301. unsigned int nodeid,
  302. struct iovec *iovec,
  303. int iov_len,
  304. int endian_conversion_required)
  305. {
  306. mar_req_header_t *header;
  307. int pos = 0;
  308. int i;
  309. int service;
  310. int fn_id;
  311. /*
  312. * Build buffer without iovecs to make processing easier
  313. * This is only used for messages which are multicast with iovecs
  314. * and self-delivered. All other mechanisms avoid the copy.
  315. */
  316. if (iov_len > 1) {
  317. for (i = 0; i < iov_len; i++) {
  318. memcpy (&delivery_data[pos], iovec[i].iov_base, iovec[i].iov_len);
  319. pos += iovec[i].iov_len;
  320. assert (pos < MESSAGE_SIZE_MAX);
  321. }
  322. header = (mar_req_header_t *)delivery_data;
  323. } else {
  324. header = (mar_req_header_t *)iovec[0].iov_base;
  325. }
  326. if (endian_conversion_required) {
  327. header->id = swab32 (header->id);
  328. header->size = swab32 (header->size);
  329. }
  330. // assert(iovec->iov_len == header->size);
  331. /*
  332. * Call the proper executive handler
  333. */
  334. service = header->id >> 16;
  335. fn_id = header->id & 0xffff;
  336. if (endian_conversion_required) {
  337. assert(ais_service[service]->exec_service[fn_id].exec_endian_convert_fn != NULL);
  338. ais_service[service]->exec_service[fn_id].exec_endian_convert_fn
  339. (header);
  340. }
  341. ais_service[service]->exec_service[fn_id].exec_handler_fn
  342. (header, nodeid);
  343. }
  344. int main (int argc, char **argv)
  345. {
  346. char *error_string;
  347. struct main_config main_config;
  348. struct totem_config totem_config;
  349. unsigned int objdb_handle;
  350. unsigned int config_handle;
  351. unsigned int config_version = 0;
  352. struct objdb_iface_ver0 *objdb;
  353. void *objdb_p;
  354. struct config_iface_ver0 *config;
  355. void *config_p;
  356. char *config_iface;
  357. int res, ch;
  358. int background, setprio;
  359. int totem_log_service;
  360. /* default configuration
  361. */
  362. background = 1;
  363. setprio = 1;
  364. while ((ch = getopt (argc, argv, "fp")) != EOF) {
  365. switch (ch) {
  366. case 'f':
  367. background = 0;
  368. break;
  369. case 'p':
  370. setprio = 0;
  371. break;
  372. default:
  373. fprintf(stderr, \
  374. "usage:\n"\
  375. " -f : Start application in foreground.\n"\
  376. " -p : Do not set process priority. \n");
  377. return EXIT_FAILURE;
  378. }
  379. }
  380. if (background)
  381. aisexec_tty_detach ();
  382. log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service RELEASE '%s'\n", RELEASE_VERSION);
  383. log_printf (LOG_LEVEL_NOTICE, "Copyright (C) 2002-2006 MontaVista Software, Inc and contributors.\n");
  384. log_printf (LOG_LEVEL_NOTICE, "Copyright (C) 2006-2007 Red Hat, Inc.\n");
  385. signal (SIGINT, sigintr_handler);
  386. signal (SIGUSR2, sigusr2_handler);
  387. signal (SIGSEGV, sigsegv_handler);
  388. signal (SIGABRT, sigabrt_handler);
  389. openais_timer_init (
  390. serialize_mutex_lock,
  391. serialize_mutex_unlock);
  392. log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service: started and ready to provide service.\n");
  393. aisexec_poll_handle = poll_create (
  394. serialize_mutex_lock,
  395. serialize_mutex_unlock);
  396. /*
  397. * Load the object database interface
  398. */
  399. res = lcr_ifact_reference (
  400. &objdb_handle,
  401. "objdb",
  402. 0,
  403. &objdb_p,
  404. 0);
  405. if (res == -1) {
  406. log_printf (LOG_LEVEL_ERROR, "AIS Executive couldn't open configuration object database component.\n");
  407. openais_exit_error (AIS_DONE_OBJDB);
  408. }
  409. objdb = (struct objdb_iface_ver0 *)objdb_p;
  410. objdb->objdb_init ();
  411. /* User's bootstrap config service */
  412. config_iface = getenv("OPENAIS_DEFAULT_CONFIG_IFACE");
  413. if (!config_iface) {
  414. config_iface = "aisparser";
  415. }
  416. res = lcr_ifact_reference (
  417. &config_handle,
  418. config_iface,
  419. config_version,
  420. &config_p,
  421. 0);
  422. config = (struct config_iface_ver0 *)config_p;
  423. if (res == -1) {
  424. log_printf (LOG_LEVEL_ERROR, "AIS Executive couldn't open configuration component.\n");
  425. openais_exit_error (AIS_DONE_MAINCONFIGREAD);
  426. }
  427. res = config->config_readconfig(objdb, &error_string);
  428. if (res == -1) {
  429. log_printf (LOG_LEVEL_ERROR, error_string);
  430. openais_exit_error (AIS_DONE_MAINCONFIGREAD);
  431. }
  432. log_printf (LOG_LEVEL_NOTICE, error_string);
  433. openais_service_default_objdb_set (objdb);
  434. res = openais_service_link_all (objdb);
  435. if (res == -1) {
  436. log_printf (LOG_LEVEL_ERROR, "Could not load services\n");
  437. openais_exit_error (AIS_DONE_DYNAMICLOAD);
  438. }
  439. res = openais_main_config_read (objdb, &error_string, &main_config);
  440. if (res == -1) {
  441. log_printf (LOG_LEVEL_ERROR, error_string);
  442. openais_exit_error (AIS_DONE_MAINCONFIGREAD);
  443. }
  444. res = totem_config_read (objdb, &totem_config, &error_string);
  445. if (res == -1) {
  446. log_printf (LOG_LEVEL_ERROR, error_string);
  447. openais_exit_error (AIS_DONE_MAINCONFIGREAD);
  448. }
  449. res = totem_config_keyread (objdb, &totem_config, &error_string);
  450. if (res == -1) {
  451. log_printf (LOG_LEVEL_ERROR, error_string);
  452. openais_exit_error (AIS_DONE_MAINCONFIGREAD);
  453. }
  454. res = totem_config_validate (&totem_config, &error_string);
  455. if (res == -1) {
  456. log_printf (LOG_LEVEL_ERROR, error_string);
  457. openais_exit_error (AIS_DONE_MAINCONFIGREAD);
  458. }
  459. res = logsys_config_file_set (&error_string, main_config.logfile);
  460. if (res == -1) {
  461. log_printf (LOG_LEVEL_ERROR, error_string);
  462. openais_exit_error (AIS_DONE_LOGSETUP);
  463. }
  464. logsys_config_facility_set ("openais", main_config.syslog_facility);
  465. logsys_config_mode_set (main_config.logmode);
  466. aisexec_uid_determine (&main_config);
  467. aisexec_gid_determine (&main_config);
  468. /*
  469. * Set round robin realtime scheduling with priority 99
  470. * Lock all memory to avoid page faults which may interrupt
  471. * application healthchecking
  472. */
  473. if (setprio)
  474. aisexec_setscheduler ();
  475. aisexec_mlockall ();
  476. totem_config.totem_logging_configuration = totem_logging_configuration;
  477. totem_log_service = _logsys_subsys_create ("TOTEM", LOG_INFO);
  478. totem_config.totem_logging_configuration.log_level_security = logsys_mkpri (LOG_LEVEL_SECURITY, totem_log_service);
  479. totem_config.totem_logging_configuration.log_level_error = logsys_mkpri (LOG_LEVEL_ERROR, totem_log_service);
  480. totem_config.totem_logging_configuration.log_level_warning = logsys_mkpri (LOG_LEVEL_WARNING, totem_log_service);
  481. totem_config.totem_logging_configuration.log_level_notice = logsys_mkpri (LOG_LEVEL_NOTICE, totem_log_service);
  482. totem_config.totem_logging_configuration.log_level_debug = logsys_mkpri (LOG_LEVEL_DEBUG, totem_log_service);
  483. totem_config.totem_logging_configuration.log_printf = logsys_log_printf;
  484. /*
  485. * Sleep for a while to let other nodes in the cluster
  486. * understand that this node has been away (if it was
  487. * an aisexec restart).
  488. */
  489. // TODO what is this hack for? usleep(totem_config.token_timeout * 2000);
  490. /*
  491. * if totempg_initialize doesn't have root priveleges, it cannot
  492. * bind to a specific interface. This only matters if
  493. * there is more then one interface in a system, so
  494. * in this case, only a warning is printed
  495. */
  496. /*
  497. * Join multicast group and setup delivery
  498. * and configuration change functions
  499. */
  500. totempg_initialize (
  501. aisexec_poll_handle,
  502. &totem_config);
  503. totempg_groups_initialize (
  504. &openais_group_handle,
  505. deliver_fn,
  506. confchg_fn);
  507. totempg_groups_join (
  508. openais_group_handle,
  509. &openais_group,
  510. 1);
  511. /*
  512. * This must occur after totempg is initialized because "this_ip" must be set
  513. */
  514. res = openais_service_init_all (service_count, objdb);
  515. if (res == -1) {
  516. log_printf (LOG_LEVEL_ERROR, "Could not init services\n");
  517. openais_exit_error (AIS_DONE_INIT_SERVICES);
  518. }
  519. sync_register (openais_sync_callbacks_retrieve, openais_sync_completed,
  520. totem_config.vsf_type);
  521. res = openais_flow_control_initialize ();
  522. /*
  523. * Drop root privleges to user 'ais'
  524. * TODO: Don't really need full root capabilities;
  525. * needed capabilities are:
  526. * CAP_NET_RAW (bindtodevice)
  527. * CAP_SYS_NICE (setscheduler)
  528. * CAP_IPC_LOCK (mlockall)
  529. */
  530. aisexec_priv_drop ();
  531. aisexec_mempool_init ();
  532. openais_ipc_init (
  533. serialize_mutex_lock,
  534. serialize_mutex_unlock,
  535. gid_valid);
  536. /*
  537. * Start main processing loop
  538. */
  539. poll_run (aisexec_poll_handle);
  540. return EXIT_SUCCESS;
  541. }