From c73089029b8145a064970a5d380247bb796418ed Mon Sep 17 00:00:00 2001 From: obarun <eric@obarun.org> Date: Sat, 18 May 2024 17:09:44 +1100 Subject: [PATCH] adapt master changes for dev branch --- src/lib66/service/service_graph_collect.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lib66/service/service_graph_collect.c b/src/lib66/service/service_graph_collect.c index 25d0f96b..8b3fc7e1 100644 --- a/src/lib66/service/service_graph_collect.c +++ b/src/lib66/service/service_graph_collect.c @@ -146,6 +146,27 @@ void service_graph_collect(graph_t *g, char const *slist, size_t slen, struct re } + /** + * In case of crash of a command and for whatever the reason, the + * service inside the module may not corresponds to the state of the + * module itself. + * + * Whatever the current state of service inside the module, we keep + * trace of its because others commands will look for these inner services. + * + * At the end of any process, the ssexec_signal will deal properly + * with the current state and the desire state of the service. */ + if (res.type == TYPE_MODULE && res.dependencies.ncontents) { + + size_t len = strlen(res.sa.s + res.dependencies.contents) ; + _alloc_stk_(stk, len + 1) ; + + if (!stack_string_clean(&stk, res.sa.s + res.dependencies.contents)) + log_dieusys(LOG_EXIT_SYS, "clean string") ; + + service_graph_collect(g, stk.s, stk.len, hres, info, flag) ; + } + free(wres) ; } } -- GitLab