mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
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 <troglobit@gmail.com>
This commit is contained in:
+3
-5
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user