mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07: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:
@@ -725,6 +725,13 @@ static int service_stop(svc_t *svc)
|
||||
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);
|
||||
|
||||
if (!svc->desc[0])
|
||||
|
||||
Reference in New Issue
Block a user