From a85c3628b8a7743ea1f491c34e3bd75339f51d57 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Fri, 28 Sep 2018 23:37:02 +0200 Subject: [PATCH] Wait for runlevel S to complete before deleting bootstrap tasks If we delete bootstrap (only) run tasks in service_start() when they complete they may be found and run again if *.conf reload takes place. Instead, mark them as having been run, like regular runtasks, and set their state directly to STOPPING. The once flag ensures the svc is not restarted if its .conf file is reloaded. Signed-off-by: Joachim Nilsson --- src/service.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/service.c b/src/service.c index a0b0bc11..2fdb1ce5 100644 --- a/src/service.c +++ b/src/service.c @@ -349,11 +349,9 @@ static int service_start(svc_t *svc) switch (svc->type) { case SVC_TYPE_RUN: result = WEXITSTATUS(complete(svc->cmd, pid)); - if (!svc_clean_bootstrap(svc)) { - svc->start_time = svc->pid = 0; - svc->once++; - svc_set_state(svc, SVC_STOPPING_STATE); - } + svc->start_time = svc->pid = 0; + svc->once++; + svc_set_state(svc, SVC_STOPPING_STATE); break; case SVC_TYPE_SERVICE: