mirror of
https://github.com/troglobit/finit.git
synced 2026-10-29 12:40:44 +00:00
Reset the starting flag of a service when stopping it
When a service is started and then stopped before it has created it's pid file, it could be left forever in the "stopping" state, if we don't reset the starting flag. Signed-off-by: Jacques de Laval <Jacques.De.Laval@westermo.com>
This commit is contained in:
1 parent
41a14391a2
commit
ee67c08b64
1 file changed
+7
@@ -725,6 +725,13 @@ static int service_stop(svc_t *svc)
|
|||||||
logit(LOG_CONSOLE | LOG_NOTICE, "Calling '%s stop' ...", svc->cmd);
|
logit(LOG_CONSOLE | LOG_NOTICE, "Calling '%s stop' ...", svc->cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make sure we are no longer considering the service to be starting (if
|
||||||
|
* that was the case). service_monitor() might get confused otherwise, and
|
||||||
|
* leave the service in a lingering, "stopping", state.
|
||||||
|
*/
|
||||||
|
svc_started(svc);
|
||||||
|
|
||||||
svc_set_state(svc, SVC_STOPPING_STATE);
|
svc_set_state(svc, SVC_STOPPING_STATE);
|
||||||
|
|
||||||
if (!svc->desc[0])
|
if (!svc->desc[0])
|
||||||
|
|||||||
Reference in new issue
Block a user