From 093b3ba467d57b286711a2ceac855f7e36e22d4f Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 25 Mar 2022 06:48:30 +0100 Subject: [PATCH] Fix problem with restarting stopped SysV init scripts SysV init scripts should not go to "done" state but "halted" so we can do: `initctl stop foo; initctl start foo`, like we do for our regular monitored services. Signed-off-by: Joachim Wiberg --- src/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service.c b/src/service.c index a2e5465d..1972d715 100644 --- a/src/service.c +++ b/src/service.c @@ -1784,6 +1784,7 @@ restart: switch (svc->type) { case SVC_TYPE_SERVICE: + case SVC_TYPE_SYSV: case SVC_TYPE_TTY: if (svc_has_post(svc)) { svc_set_state(svc, SVC_CLEANUP_STATE); @@ -1794,7 +1795,6 @@ restart: case SVC_TYPE_TASK: case SVC_TYPE_RUN: - case SVC_TYPE_SYSV: svc_set_state(svc, SVC_DONE_STATE); break;