service.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. /*
  2. * Copyright (c) 2006 MontaVista Software, Inc.
  3. * Copyright (c) 2006-2009 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 <stdlib.h>
  37. #include <string.h>
  38. #include <corosync/lcr/lcr_ifact.h>
  39. #include <corosync/swab.h>
  40. #include <corosync/totem/totem.h>
  41. #include <corosync/corotypes.h>
  42. #include "mainconfig.h"
  43. #include "util.h"
  44. #include <corosync/engine/logsys.h>
  45. #include "timer.h"
  46. #include <corosync/totem/totempg.h>
  47. #include <corosync/totem/totemip.h>
  48. #include "main.h"
  49. #include <corosync/engine/coroapi.h>
  50. #include "service.h"
  51. #include <qb/qbipcs.h>
  52. #include <qb/qbloop.h>
  53. LOGSYS_DECLARE_SUBSYS ("SERV");
  54. struct default_service {
  55. const char *name;
  56. int ver;
  57. };
  58. static struct default_service default_services[] = {
  59. {
  60. .name = "corosync_evs",
  61. .ver = 0,
  62. },
  63. {
  64. .name = "corosync_cfg",
  65. .ver = 0,
  66. },
  67. {
  68. .name = "corosync_cpg",
  69. .ver = 0,
  70. },
  71. {
  72. .name = "corosync_confdb",
  73. .ver = 0,
  74. },
  75. {
  76. .name = "corosync_pload",
  77. .ver = 0,
  78. },
  79. #ifdef HAVE_MONITORING
  80. {
  81. .name = "corosync_mon",
  82. .ver = 0,
  83. },
  84. #endif
  85. #ifdef HAVE_WATCHDOG
  86. {
  87. .name = "corosync_wd",
  88. .ver = 0,
  89. },
  90. #endif
  91. {
  92. .name = "corosync_quorum",
  93. .ver = 0,
  94. }
  95. };
  96. /*
  97. * service exit and unlink schedwrk handler data structure
  98. */
  99. struct seus_handler_data {
  100. hdb_handle_t service_handle;
  101. int service_engine;
  102. struct corosync_api_v1 *api;
  103. };
  104. struct corosync_service_engine *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
  105. hdb_handle_t service_stats_handle[SERVICE_HANDLER_MAXIMUM_COUNT][64];
  106. int ais_service_exiting[SERVICE_HANDLER_MAXIMUM_COUNT];
  107. static hdb_handle_t object_internal_configuration_handle;
  108. static hdb_handle_t object_stats_services_handle;
  109. static void (*service_unlink_all_complete) (void) = NULL;
  110. static unsigned int default_services_requested (struct corosync_api_v1 *corosync_api)
  111. {
  112. hdb_handle_t object_service_handle;
  113. hdb_handle_t object_find_handle;
  114. char *value;
  115. /*
  116. * Don't link default services if they have been disabled
  117. */
  118. corosync_api->object_find_create (
  119. OBJECT_PARENT_HANDLE,
  120. "aisexec",
  121. strlen ("aisexec"),
  122. &object_find_handle);
  123. if (corosync_api->object_find_next (
  124. object_find_handle,
  125. &object_service_handle) == 0) {
  126. if ( ! corosync_api->object_key_get (object_service_handle,
  127. "defaultservices",
  128. strlen ("defaultservices"),
  129. (void *)&value,
  130. NULL)) {
  131. if (value && strcmp (value, "no") == 0) {
  132. return 0;
  133. }
  134. }
  135. }
  136. corosync_api->object_find_destroy (object_find_handle);
  137. return (-1);
  138. }
  139. unsigned int corosync_service_link_and_init (
  140. struct corosync_api_v1 *corosync_api,
  141. const char *service_name,
  142. unsigned int service_ver)
  143. {
  144. struct corosync_service_engine_iface_ver0 *iface_ver0;
  145. void *iface_ver0_p;
  146. hdb_handle_t handle;
  147. struct corosync_service_engine *service;
  148. int res;
  149. hdb_handle_t object_service_handle;
  150. hdb_handle_t object_stats_handle;
  151. int fn;
  152. char object_name[32];
  153. char *name_sufix;
  154. uint64_t zero_64 = 0;
  155. void* _start;
  156. void* _stop;
  157. /*
  158. * reference the service interface
  159. */
  160. iface_ver0_p = NULL;
  161. res = lcr_ifact_reference (
  162. &handle,
  163. service_name,
  164. service_ver,
  165. &iface_ver0_p,
  166. (void *)0);
  167. iface_ver0 = (struct corosync_service_engine_iface_ver0 *)iface_ver0_p;
  168. if (res == -1 || iface_ver0 == 0) {
  169. log_printf(LOGSYS_LEVEL_ERROR, "Service failed to load '%s'.\n", service_name);
  170. return (-1);
  171. }
  172. /*
  173. * Initialize service
  174. */
  175. service = iface_ver0->corosync_get_service_engine_ver0();
  176. ais_service[service->id] = service;
  177. /*
  178. * Register the log sites with libqb
  179. */
  180. _start = lcr_ifact_addr_get(handle, "__start___verbose");
  181. _stop = lcr_ifact_addr_get(handle, "__stop___verbose");
  182. qb_log_callsites_register(_start, _stop);
  183. if (service->config_init_fn) {
  184. res = service->config_init_fn (corosync_api);
  185. }
  186. if (service->exec_init_fn) {
  187. res = service->exec_init_fn (corosync_api);
  188. }
  189. /*
  190. * Store service in object database
  191. */
  192. corosync_api->object_create (object_internal_configuration_handle,
  193. &object_service_handle,
  194. "service",
  195. strlen ("service"));
  196. corosync_api->object_key_create_typed (object_service_handle,
  197. "name",
  198. service_name,
  199. strlen (service_name) + 1, OBJDB_VALUETYPE_STRING);
  200. corosync_api->object_key_create_typed (object_service_handle,
  201. "ver",
  202. &service_ver,
  203. sizeof (service_ver), OBJDB_VALUETYPE_UINT32);
  204. res = corosync_api->object_key_create_typed (object_service_handle,
  205. "handle",
  206. &handle,
  207. sizeof (handle), OBJDB_VALUETYPE_UINT64);
  208. corosync_api->object_key_create_typed (object_service_handle,
  209. "service_id",
  210. &service->id,
  211. sizeof (service->id), OBJDB_VALUETYPE_UINT16);
  212. name_sufix = strrchr (service_name, '_');
  213. if (name_sufix)
  214. name_sufix++;
  215. else
  216. name_sufix = (char*)service_name;
  217. corosync_api->object_create (object_stats_services_handle,
  218. &object_stats_handle,
  219. name_sufix, strlen (name_sufix));
  220. corosync_api->object_key_create_typed (object_stats_handle,
  221. "service_id",
  222. &service->id, sizeof (service->id),
  223. OBJDB_VALUETYPE_INT16);
  224. for (fn = 0; fn < service->exec_engine_count; fn++) {
  225. snprintf (object_name, 32, "%d", fn);
  226. corosync_api->object_create (object_stats_handle,
  227. &service_stats_handle[service->id][fn],
  228. object_name, strlen (object_name));
  229. corosync_api->object_key_create_typed (service_stats_handle[service->id][fn],
  230. "tx",
  231. &zero_64, sizeof (zero_64),
  232. OBJDB_VALUETYPE_UINT64);
  233. corosync_api->object_key_create_typed (service_stats_handle[service->id][fn],
  234. "rx",
  235. &zero_64, sizeof (zero_64),
  236. OBJDB_VALUETYPE_UINT64);
  237. }
  238. log_printf (LOGSYS_LEVEL_NOTICE,
  239. "Service engine loaded: %s [%d]\n", service->name, service->id);
  240. cs_ipcs_service_init(service);
  241. return (res);
  242. }
  243. static int service_priority_max(void)
  244. {
  245. int lpc = 0, max = 0;
  246. for(; lpc < SERVICE_HANDLER_MAXIMUM_COUNT; lpc++) {
  247. if(ais_service[lpc] != NULL && ais_service[lpc]->priority > max) {
  248. max = ais_service[lpc]->priority;
  249. }
  250. }
  251. return max;
  252. }
  253. /*
  254. * use the force
  255. */
  256. static unsigned int
  257. corosync_service_unlink_priority (
  258. struct corosync_api_v1 *corosync_api,
  259. int lowest_priority,
  260. int *current_priority,
  261. int *current_service_engine,
  262. hdb_handle_t *current_service_handle)
  263. {
  264. unsigned short *service_id;
  265. hdb_handle_t object_service_handle;
  266. hdb_handle_t object_find_handle;
  267. hdb_handle_t *found_service_handle;
  268. for(; *current_priority >= lowest_priority; *current_priority = *current_priority - 1) {
  269. for(*current_service_engine = 0;
  270. *current_service_engine < SERVICE_HANDLER_MAXIMUM_COUNT;
  271. *current_service_engine = *current_service_engine + 1) {
  272. if(ais_service[*current_service_engine] == NULL ||
  273. ais_service[*current_service_engine]->priority != *current_priority) {
  274. continue;
  275. }
  276. /*
  277. * find service object in object database by service id
  278. * and unload it if possible.
  279. *
  280. * If the service engine's exec_exit_fn returns -1 indicating
  281. * it was busy, this function returns -1 and can be called again
  282. * at a later time (usually via the schedwrk api).
  283. */
  284. corosync_api->object_find_create (
  285. object_internal_configuration_handle,
  286. "service", strlen ("service"), &object_find_handle);
  287. while (corosync_api->object_find_next (
  288. object_find_handle, &object_service_handle) == 0) {
  289. int res = corosync_api->object_key_get (
  290. object_service_handle,
  291. "service_id", strlen ("service_id"),
  292. (void *)&service_id, NULL);
  293. if (res == 0 && *service_id ==
  294. ais_service[*current_service_engine]->id) {
  295. if (ais_service[*service_id]->exec_exit_fn) {
  296. res = ais_service[*service_id]->exec_exit_fn ();
  297. if (res == -1) {
  298. corosync_api->object_find_destroy (object_find_handle);
  299. return (-1);
  300. }
  301. }
  302. res = corosync_api->object_key_get (
  303. object_service_handle,
  304. "handle", strlen ("handle"),
  305. (void *)&found_service_handle,
  306. NULL);
  307. *current_service_handle = *found_service_handle;
  308. ais_service_exiting[*current_service_engine] = 1;
  309. corosync_api->object_find_destroy (object_find_handle);
  310. /*
  311. * Call should call this function again
  312. */
  313. return (1);
  314. }
  315. }
  316. corosync_api->object_find_destroy (object_find_handle);
  317. }
  318. }
  319. /*
  320. * We finish unlink of all services -> no need to call this function again
  321. */
  322. return (0);
  323. }
  324. static unsigned int service_unlink_and_exit (
  325. struct corosync_api_v1 *corosync_api,
  326. const char *service_name,
  327. unsigned int service_ver)
  328. {
  329. hdb_handle_t object_service_handle;
  330. char *found_service_name;
  331. unsigned short *service_id;
  332. unsigned int *found_service_ver;
  333. hdb_handle_t object_find_handle;
  334. hdb_handle_t *found_service_handle;
  335. char *name_sufix;
  336. int res;
  337. name_sufix = strrchr (service_name, '_');
  338. if (name_sufix)
  339. name_sufix++;
  340. else
  341. name_sufix = (char*)service_name;
  342. corosync_api->object_find_create (
  343. object_stats_services_handle,
  344. name_sufix, strlen (name_sufix),
  345. &object_find_handle);
  346. if (corosync_api->object_find_next (
  347. object_find_handle,
  348. &object_service_handle) == 0) {
  349. corosync_api->object_destroy (object_service_handle);
  350. }
  351. corosync_api->object_find_destroy (object_find_handle);
  352. corosync_api->object_find_create (
  353. object_internal_configuration_handle,
  354. "service",
  355. strlen ("service"),
  356. &object_find_handle);
  357. while (corosync_api->object_find_next (
  358. object_find_handle,
  359. &object_service_handle) == 0) {
  360. corosync_api->object_key_get (object_service_handle,
  361. "name",
  362. strlen ("name"),
  363. (void *)&found_service_name,
  364. NULL);
  365. if (strcmp (service_name, found_service_name) != 0) {
  366. continue;
  367. }
  368. corosync_api->object_key_get (object_service_handle,
  369. "ver",
  370. strlen ("ver"),
  371. (void *)&found_service_ver,
  372. NULL);
  373. /*
  374. * If service found and linked exit it
  375. */
  376. if (service_ver != *found_service_ver) {
  377. continue;
  378. }
  379. corosync_api->object_key_get (
  380. object_service_handle,
  381. "service_id", strlen ("service_id"),
  382. (void *)&service_id, NULL);
  383. if(service_id != NULL
  384. && *service_id < SERVICE_HANDLER_MAXIMUM_COUNT
  385. && ais_service[*service_id] != NULL) {
  386. corosync_api->object_find_destroy (object_find_handle);
  387. if (ais_service[*service_id]->exec_exit_fn) {
  388. res = ais_service[*service_id]->exec_exit_fn ();
  389. if (res == -1) {
  390. return (-1);
  391. }
  392. }
  393. log_printf(LOGSYS_LEVEL_NOTICE,
  394. "Service engine unloaded: %s\n",
  395. ais_service[*service_id]->name);
  396. ais_service[*service_id] = NULL;
  397. res = corosync_api->object_key_get (
  398. object_service_handle,
  399. "handle", strlen ("handle"),
  400. (void *)&found_service_handle,
  401. NULL);
  402. cs_ipcs_service_destroy (*service_id);
  403. lcr_ifact_release (*found_service_handle);
  404. corosync_api->object_destroy (object_service_handle);
  405. }
  406. }
  407. corosync_api->object_find_destroy (object_find_handle);
  408. return (0);
  409. }
  410. /*
  411. * Links default services into the executive
  412. */
  413. unsigned int corosync_service_defaults_link_and_init (struct corosync_api_v1 *corosync_api)
  414. {
  415. unsigned int i;
  416. hdb_handle_t object_service_handle;
  417. char *found_service_name;
  418. char *found_service_ver;
  419. unsigned int found_service_ver_atoi;
  420. hdb_handle_t object_find_handle;
  421. hdb_handle_t object_find2_handle;
  422. hdb_handle_t object_runtime_handle;
  423. corosync_api->object_find_create (
  424. OBJECT_PARENT_HANDLE,
  425. "runtime",
  426. strlen ("runtime"),
  427. &object_find2_handle);
  428. if (corosync_api->object_find_next (
  429. object_find2_handle,
  430. &object_runtime_handle) == 0) {
  431. corosync_api->object_create (object_runtime_handle,
  432. &object_stats_services_handle,
  433. "services", strlen ("services"));
  434. }
  435. corosync_api->object_find_destroy (object_find2_handle);
  436. corosync_api->object_create (OBJECT_PARENT_HANDLE,
  437. &object_internal_configuration_handle,
  438. "internal_configuration",
  439. strlen ("internal_configuration"));
  440. corosync_api->object_find_create (
  441. OBJECT_PARENT_HANDLE,
  442. "service",
  443. strlen ("service"),
  444. &object_find_handle);
  445. while (corosync_api->object_find_next (
  446. object_find_handle,
  447. &object_service_handle) == 0) {
  448. corosync_api->object_key_get (object_service_handle,
  449. "name",
  450. strlen ("name"),
  451. (void *)&found_service_name,
  452. NULL);
  453. found_service_ver = NULL;
  454. corosync_api->object_key_get (object_service_handle,
  455. "ver",
  456. strlen ("ver"),
  457. (void *)&found_service_ver,
  458. NULL);
  459. found_service_ver_atoi = (found_service_ver ? atoi (found_service_ver) : 0);
  460. corosync_service_link_and_init (
  461. corosync_api,
  462. found_service_name,
  463. found_service_ver_atoi);
  464. }
  465. corosync_api->object_find_destroy (object_find_handle);
  466. if (default_services_requested (corosync_api) == 0) {
  467. return (0);
  468. }
  469. for (i = 0;
  470. i < sizeof (default_services) / sizeof (struct default_service); i++) {
  471. corosync_service_link_and_init (
  472. corosync_api,
  473. default_services[i].name,
  474. default_services[i].ver);
  475. }
  476. return (0);
  477. }
  478. /*
  479. * Declaration of exit_schedwrk_handler, because of cycle
  480. * (service_exit_schedwrk_handler calls service_unlink_schedwrk_handler, and vice-versa)
  481. */
  482. static void service_exit_schedwrk_handler (void *data);
  483. static void service_unlink_schedwrk_handler (void *data) {
  484. struct seus_handler_data *cb_data = (struct seus_handler_data *)data;
  485. /*
  486. * Exit all ipc connections dependent on this service
  487. */
  488. if (cs_ipcs_service_destroy (cb_data->service_engine) == -1) {
  489. goto redo_this_function;
  490. }
  491. log_printf(LOGSYS_LEVEL_NOTICE,
  492. "Service engine unloaded: %s\n",
  493. ais_service[cb_data->service_engine]->name);
  494. ais_service[cb_data->service_engine] = NULL;
  495. lcr_ifact_release (cb_data->service_handle);
  496. qb_loop_job_add(cs_poll_handle_get(),
  497. QB_LOOP_HIGH,
  498. data,
  499. service_exit_schedwrk_handler);
  500. return;
  501. redo_this_function:
  502. qb_loop_job_add(cs_poll_handle_get(),
  503. QB_LOOP_HIGH,
  504. data,
  505. service_unlink_schedwrk_handler);
  506. }
  507. static void service_exit_schedwrk_handler (void *data) {
  508. int res;
  509. static int current_priority = 0;
  510. static int current_service_engine = 0;
  511. static int called = 0;
  512. struct seus_handler_data *cb_data = (struct seus_handler_data *)data;
  513. struct corosync_api_v1 *api = (struct corosync_api_v1 *)cb_data->api;
  514. hdb_handle_t service_handle;
  515. if (called == 0) {
  516. log_printf(LOGSYS_LEVEL_NOTICE,
  517. "Unloading all Corosync service engines.\n");
  518. current_priority = service_priority_max ();
  519. called = 1;
  520. }
  521. res = corosync_service_unlink_priority (
  522. api,
  523. 0,
  524. &current_priority,
  525. &current_service_engine,
  526. &service_handle);
  527. if (res == 0) {
  528. service_unlink_all_complete();
  529. return;
  530. }
  531. if (res == 1) {
  532. cb_data->service_engine = current_service_engine;
  533. cb_data->service_handle = service_handle;
  534. qb_loop_job_add(cs_poll_handle_get(),
  535. QB_LOOP_HIGH,
  536. data,
  537. service_unlink_schedwrk_handler);
  538. return;
  539. }
  540. qb_loop_job_add(cs_poll_handle_get(),
  541. QB_LOOP_HIGH,
  542. data,
  543. service_exit_schedwrk_handler);
  544. }
  545. void corosync_service_unlink_all (
  546. struct corosync_api_v1 *api,
  547. void (*unlink_all_complete) (void))
  548. {
  549. static int called = 0;
  550. static struct seus_handler_data cb_data;
  551. assert (api);
  552. service_unlink_all_complete = unlink_all_complete;
  553. if (called) {
  554. return;
  555. }
  556. if (called == 0) {
  557. called = 1;
  558. }
  559. cb_data.api = api;
  560. qb_loop_job_add(cs_poll_handle_get(),
  561. QB_LOOP_HIGH,
  562. &cb_data,
  563. service_exit_schedwrk_handler);
  564. }
  565. struct service_unlink_and_exit_data {
  566. hdb_handle_t handle;
  567. struct corosync_api_v1 *api;
  568. const char *name;
  569. unsigned int ver;
  570. };
  571. static void service_unlink_and_exit_schedwrk_handler (void *data)
  572. {
  573. struct service_unlink_and_exit_data *service_unlink_and_exit_data =
  574. data;
  575. int res;
  576. res = service_unlink_and_exit (
  577. service_unlink_and_exit_data->api,
  578. service_unlink_and_exit_data->name,
  579. service_unlink_and_exit_data->ver);
  580. if (res == 0) {
  581. free (service_unlink_and_exit_data);
  582. } else {
  583. qb_loop_job_add(cs_poll_handle_get(),
  584. QB_LOOP_HIGH,
  585. data,
  586. service_unlink_and_exit_schedwrk_handler);
  587. }
  588. }
  589. typedef int (*schedwrk_cast) (const void *);
  590. unsigned int corosync_service_unlink_and_exit (
  591. struct corosync_api_v1 *api,
  592. const char *service_name,
  593. unsigned int service_ver)
  594. {
  595. struct service_unlink_and_exit_data *service_unlink_and_exit_data;
  596. assert (api);
  597. service_unlink_and_exit_data = malloc (sizeof (struct service_unlink_and_exit_data));
  598. service_unlink_and_exit_data->api = api;
  599. service_unlink_and_exit_data->name = strdup (service_name);
  600. service_unlink_and_exit_data->ver = service_ver;
  601. qb_loop_job_add(cs_poll_handle_get(),
  602. QB_LOOP_HIGH,
  603. service_unlink_and_exit_data,
  604. service_unlink_and_exit_schedwrk_handler);
  605. return (0);
  606. }