service.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  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. /* begin */
  178. _start = lcr_ifact_addr_get(handle, "__start___verbose");
  179. _stop = lcr_ifact_addr_get(handle, "__stop___verbose");
  180. qb_log_callsites_register(_start, _stop);
  181. /* end */
  182. if (service->config_init_fn) {
  183. res = service->config_init_fn (corosync_api);
  184. }
  185. if (service->exec_init_fn) {
  186. res = service->exec_init_fn (corosync_api);
  187. }
  188. /*
  189. * Store service in object database
  190. */
  191. corosync_api->object_create (object_internal_configuration_handle,
  192. &object_service_handle,
  193. "service",
  194. strlen ("service"));
  195. corosync_api->object_key_create_typed (object_service_handle,
  196. "name",
  197. service_name,
  198. strlen (service_name) + 1, OBJDB_VALUETYPE_STRING);
  199. corosync_api->object_key_create_typed (object_service_handle,
  200. "ver",
  201. &service_ver,
  202. sizeof (service_ver), OBJDB_VALUETYPE_UINT32);
  203. res = corosync_api->object_key_create_typed (object_service_handle,
  204. "handle",
  205. &handle,
  206. sizeof (handle), OBJDB_VALUETYPE_UINT64);
  207. corosync_api->object_key_create_typed (object_service_handle,
  208. "service_id",
  209. &service->id,
  210. sizeof (service->id), OBJDB_VALUETYPE_UINT16);
  211. name_sufix = strrchr (service_name, '_');
  212. if (name_sufix)
  213. name_sufix++;
  214. else
  215. name_sufix = (char*)service_name;
  216. corosync_api->object_create (object_stats_services_handle,
  217. &object_stats_handle,
  218. name_sufix, strlen (name_sufix));
  219. corosync_api->object_key_create_typed (object_stats_handle,
  220. "service_id",
  221. &service->id, sizeof (service->id),
  222. OBJDB_VALUETYPE_INT16);
  223. for (fn = 0; fn < service->exec_engine_count; fn++) {
  224. snprintf (object_name, 32, "%d", fn);
  225. corosync_api->object_create (object_stats_handle,
  226. &service_stats_handle[service->id][fn],
  227. object_name, strlen (object_name));
  228. corosync_api->object_key_create_typed (service_stats_handle[service->id][fn],
  229. "tx",
  230. &zero_64, sizeof (zero_64),
  231. OBJDB_VALUETYPE_UINT64);
  232. corosync_api->object_key_create_typed (service_stats_handle[service->id][fn],
  233. "rx",
  234. &zero_64, sizeof (zero_64),
  235. OBJDB_VALUETYPE_UINT64);
  236. }
  237. log_printf (LOGSYS_LEVEL_NOTICE,
  238. "Service engine loaded: %s [%d]\n", service->name, service->id);
  239. cs_ipcs_service_init(service);
  240. return (res);
  241. }
  242. static int service_priority_max(void)
  243. {
  244. int lpc = 0, max = 0;
  245. for(; lpc < SERVICE_HANDLER_MAXIMUM_COUNT; lpc++) {
  246. if(ais_service[lpc] != NULL && ais_service[lpc]->priority > max) {
  247. max = ais_service[lpc]->priority;
  248. }
  249. }
  250. return max;
  251. }
  252. /*
  253. * use the force
  254. */
  255. static unsigned int
  256. corosync_service_unlink_priority (
  257. struct corosync_api_v1 *corosync_api,
  258. int lowest_priority,
  259. int *current_priority,
  260. int *current_service_engine,
  261. hdb_handle_t *current_service_handle)
  262. {
  263. unsigned short *service_id;
  264. hdb_handle_t object_service_handle;
  265. hdb_handle_t object_find_handle;
  266. hdb_handle_t *found_service_handle;
  267. for(; *current_priority >= lowest_priority; *current_priority = *current_priority - 1) {
  268. for(*current_service_engine = 0;
  269. *current_service_engine < SERVICE_HANDLER_MAXIMUM_COUNT;
  270. *current_service_engine = *current_service_engine + 1) {
  271. if(ais_service[*current_service_engine] == NULL ||
  272. ais_service[*current_service_engine]->priority != *current_priority) {
  273. continue;
  274. }
  275. /*
  276. * find service object in object database by service id
  277. * and unload it if possible.
  278. *
  279. * If the service engine's exec_exit_fn returns -1 indicating
  280. * it was busy, this function returns -1 and can be called again
  281. * at a later time (usually via the schedwrk api).
  282. */
  283. corosync_api->object_find_create (
  284. object_internal_configuration_handle,
  285. "service", strlen ("service"), &object_find_handle);
  286. while (corosync_api->object_find_next (
  287. object_find_handle, &object_service_handle) == 0) {
  288. int res = corosync_api->object_key_get (
  289. object_service_handle,
  290. "service_id", strlen ("service_id"),
  291. (void *)&service_id, NULL);
  292. if (res == 0 && *service_id ==
  293. ais_service[*current_service_engine]->id) {
  294. if (ais_service[*service_id]->exec_exit_fn) {
  295. res = ais_service[*service_id]->exec_exit_fn ();
  296. if (res == -1) {
  297. corosync_api->object_find_destroy (object_find_handle);
  298. return (-1);
  299. }
  300. }
  301. res = corosync_api->object_key_get (
  302. object_service_handle,
  303. "handle", strlen ("handle"),
  304. (void *)&found_service_handle,
  305. NULL);
  306. *current_service_handle = *found_service_handle;
  307. ais_service_exiting[*current_service_engine] = 1;
  308. corosync_api->object_find_destroy (object_find_handle);
  309. /*
  310. * Call should call this function again
  311. */
  312. return (1);
  313. }
  314. }
  315. corosync_api->object_find_destroy (object_find_handle);
  316. }
  317. }
  318. /*
  319. * We finish unlink of all services -> no need to call this function again
  320. */
  321. return (0);
  322. }
  323. static unsigned int service_unlink_and_exit (
  324. struct corosync_api_v1 *corosync_api,
  325. const char *service_name,
  326. unsigned int service_ver)
  327. {
  328. hdb_handle_t object_service_handle;
  329. char *found_service_name;
  330. unsigned short *service_id;
  331. unsigned int *found_service_ver;
  332. hdb_handle_t object_find_handle;
  333. hdb_handle_t *found_service_handle;
  334. char *name_sufix;
  335. int res;
  336. name_sufix = strrchr (service_name, '_');
  337. if (name_sufix)
  338. name_sufix++;
  339. else
  340. name_sufix = (char*)service_name;
  341. corosync_api->object_find_create (
  342. object_stats_services_handle,
  343. name_sufix, strlen (name_sufix),
  344. &object_find_handle);
  345. if (corosync_api->object_find_next (
  346. object_find_handle,
  347. &object_service_handle) == 0) {
  348. corosync_api->object_destroy (object_service_handle);
  349. }
  350. corosync_api->object_find_destroy (object_find_handle);
  351. corosync_api->object_find_create (
  352. object_internal_configuration_handle,
  353. "service",
  354. strlen ("service"),
  355. &object_find_handle);
  356. while (corosync_api->object_find_next (
  357. object_find_handle,
  358. &object_service_handle) == 0) {
  359. corosync_api->object_key_get (object_service_handle,
  360. "name",
  361. strlen ("name"),
  362. (void *)&found_service_name,
  363. NULL);
  364. if (strcmp (service_name, found_service_name) != 0) {
  365. continue;
  366. }
  367. corosync_api->object_key_get (object_service_handle,
  368. "ver",
  369. strlen ("ver"),
  370. (void *)&found_service_ver,
  371. NULL);
  372. /*
  373. * If service found and linked exit it
  374. */
  375. if (service_ver != *found_service_ver) {
  376. continue;
  377. }
  378. corosync_api->object_key_get (
  379. object_service_handle,
  380. "service_id", strlen ("service_id"),
  381. (void *)&service_id, NULL);
  382. if(service_id != NULL
  383. && *service_id < SERVICE_HANDLER_MAXIMUM_COUNT
  384. && ais_service[*service_id] != NULL) {
  385. corosync_api->object_find_destroy (object_find_handle);
  386. if (ais_service[*service_id]->exec_exit_fn) {
  387. res = ais_service[*service_id]->exec_exit_fn ();
  388. if (res == -1) {
  389. return (-1);
  390. }
  391. }
  392. log_printf(LOGSYS_LEVEL_NOTICE,
  393. "Service engine unloaded: %s\n",
  394. ais_service[*service_id]->name);
  395. ais_service[*service_id] = NULL;
  396. res = corosync_api->object_key_get (
  397. object_service_handle,
  398. "handle", strlen ("handle"),
  399. (void *)&found_service_handle,
  400. NULL);
  401. cs_ipcs_service_destroy (*service_id);
  402. lcr_ifact_release (*found_service_handle);
  403. corosync_api->object_destroy (object_service_handle);
  404. }
  405. }
  406. corosync_api->object_find_destroy (object_find_handle);
  407. return (0);
  408. }
  409. /*
  410. * Links default services into the executive
  411. */
  412. unsigned int corosync_service_defaults_link_and_init (struct corosync_api_v1 *corosync_api)
  413. {
  414. unsigned int i;
  415. hdb_handle_t object_service_handle;
  416. char *found_service_name;
  417. char *found_service_ver;
  418. unsigned int found_service_ver_atoi;
  419. hdb_handle_t object_find_handle;
  420. hdb_handle_t object_find2_handle;
  421. hdb_handle_t object_runtime_handle;
  422. corosync_api->object_find_create (
  423. OBJECT_PARENT_HANDLE,
  424. "runtime",
  425. strlen ("runtime"),
  426. &object_find2_handle);
  427. if (corosync_api->object_find_next (
  428. object_find2_handle,
  429. &object_runtime_handle) == 0) {
  430. corosync_api->object_create (object_runtime_handle,
  431. &object_stats_services_handle,
  432. "services", strlen ("services"));
  433. }
  434. corosync_api->object_find_destroy (object_find2_handle);
  435. corosync_api->object_create (OBJECT_PARENT_HANDLE,
  436. &object_internal_configuration_handle,
  437. "internal_configuration",
  438. strlen ("internal_configuration"));
  439. corosync_api->object_find_create (
  440. OBJECT_PARENT_HANDLE,
  441. "service",
  442. strlen ("service"),
  443. &object_find_handle);
  444. while (corosync_api->object_find_next (
  445. object_find_handle,
  446. &object_service_handle) == 0) {
  447. corosync_api->object_key_get (object_service_handle,
  448. "name",
  449. strlen ("name"),
  450. (void *)&found_service_name,
  451. NULL);
  452. found_service_ver = NULL;
  453. corosync_api->object_key_get (object_service_handle,
  454. "ver",
  455. strlen ("ver"),
  456. (void *)&found_service_ver,
  457. NULL);
  458. found_service_ver_atoi = (found_service_ver ? atoi (found_service_ver) : 0);
  459. corosync_service_link_and_init (
  460. corosync_api,
  461. found_service_name,
  462. found_service_ver_atoi);
  463. }
  464. corosync_api->object_find_destroy (object_find_handle);
  465. if (default_services_requested (corosync_api) == 0) {
  466. return (0);
  467. }
  468. for (i = 0;
  469. i < sizeof (default_services) / sizeof (struct default_service); i++) {
  470. corosync_service_link_and_init (
  471. corosync_api,
  472. default_services[i].name,
  473. default_services[i].ver);
  474. }
  475. return (0);
  476. }
  477. /*
  478. * Declaration of exit_schedwrk_handler, because of cycle
  479. * (service_exit_schedwrk_handler calls service_unlink_schedwrk_handler, and vice-versa)
  480. */
  481. static void service_exit_schedwrk_handler (void *data);
  482. static void service_unlink_schedwrk_handler (void *data) {
  483. struct seus_handler_data *cb_data = (struct seus_handler_data *)data;
  484. /*
  485. * Exit all ipc connections dependent on this service
  486. */
  487. if (cs_ipcs_service_destroy (cb_data->service_engine) == -1) {
  488. goto redo_this_function;
  489. }
  490. log_printf(LOGSYS_LEVEL_NOTICE,
  491. "Service engine unloaded: %s\n",
  492. ais_service[cb_data->service_engine]->name);
  493. ais_service[cb_data->service_engine] = NULL;
  494. lcr_ifact_release (cb_data->service_handle);
  495. qb_loop_job_add(cs_poll_handle_get(),
  496. QB_LOOP_HIGH,
  497. data,
  498. service_exit_schedwrk_handler);
  499. return;
  500. redo_this_function:
  501. qb_loop_job_add(cs_poll_handle_get(),
  502. QB_LOOP_HIGH,
  503. data,
  504. service_unlink_schedwrk_handler);
  505. }
  506. static void service_exit_schedwrk_handler (void *data) {
  507. int res;
  508. static int current_priority = 0;
  509. static int current_service_engine = 0;
  510. static int called = 0;
  511. struct seus_handler_data *cb_data = (struct seus_handler_data *)data;
  512. struct corosync_api_v1 *api = (struct corosync_api_v1 *)cb_data->api;
  513. hdb_handle_t service_handle;
  514. if (called == 0) {
  515. log_printf(LOGSYS_LEVEL_NOTICE,
  516. "Unloading all Corosync service engines.\n");
  517. current_priority = service_priority_max ();
  518. called = 1;
  519. }
  520. res = corosync_service_unlink_priority (
  521. api,
  522. 0,
  523. &current_priority,
  524. &current_service_engine,
  525. &service_handle);
  526. if (res == 0) {
  527. service_unlink_all_complete();
  528. return;
  529. }
  530. if (res == 1) {
  531. cb_data->service_engine = current_service_engine;
  532. cb_data->service_handle = service_handle;
  533. qb_loop_job_add(cs_poll_handle_get(),
  534. QB_LOOP_HIGH,
  535. data,
  536. service_unlink_schedwrk_handler);
  537. return;
  538. }
  539. qb_loop_job_add(cs_poll_handle_get(),
  540. QB_LOOP_HIGH,
  541. data,
  542. service_exit_schedwrk_handler);
  543. }
  544. void corosync_service_unlink_all (
  545. struct corosync_api_v1 *api,
  546. void (*unlink_all_complete) (void))
  547. {
  548. static int called = 0;
  549. static struct seus_handler_data cb_data;
  550. assert (api);
  551. service_unlink_all_complete = unlink_all_complete;
  552. if (called) {
  553. return;
  554. }
  555. if (called == 0) {
  556. called = 1;
  557. }
  558. cb_data.api = api;
  559. qb_loop_job_add(cs_poll_handle_get(),
  560. QB_LOOP_HIGH,
  561. &cb_data,
  562. service_exit_schedwrk_handler);
  563. }
  564. struct service_unlink_and_exit_data {
  565. hdb_handle_t handle;
  566. struct corosync_api_v1 *api;
  567. const char *name;
  568. unsigned int ver;
  569. };
  570. static void service_unlink_and_exit_schedwrk_handler (void *data)
  571. {
  572. struct service_unlink_and_exit_data *service_unlink_and_exit_data =
  573. data;
  574. int res;
  575. res = service_unlink_and_exit (
  576. service_unlink_and_exit_data->api,
  577. service_unlink_and_exit_data->name,
  578. service_unlink_and_exit_data->ver);
  579. if (res == 0) {
  580. free (service_unlink_and_exit_data);
  581. } else {
  582. qb_loop_job_add(cs_poll_handle_get(),
  583. QB_LOOP_HIGH,
  584. data,
  585. service_unlink_and_exit_schedwrk_handler);
  586. }
  587. }
  588. typedef int (*schedwrk_cast) (const void *);
  589. unsigned int corosync_service_unlink_and_exit (
  590. struct corosync_api_v1 *api,
  591. const char *service_name,
  592. unsigned int service_ver)
  593. {
  594. struct service_unlink_and_exit_data *service_unlink_and_exit_data;
  595. assert (api);
  596. service_unlink_and_exit_data = malloc (sizeof (struct service_unlink_and_exit_data));
  597. service_unlink_and_exit_data->api = api;
  598. service_unlink_and_exit_data->name = strdup (service_name);
  599. service_unlink_and_exit_data->ver = service_ver;
  600. qb_loop_job_add(cs_poll_handle_get(),
  601. QB_LOOP_HIGH,
  602. service_unlink_and_exit_data,
  603. service_unlink_and_exit_schedwrk_handler);
  604. return (0);
  605. }