mirror of
https://github.com/troglobit/finit.git
synced 2026-10-31 13:00:32 +00:00
Clear stale PID conditions when a service stops
Protect against corner cases where pid conditions are not cleaned up. We don't want such conditions to remain asserted when the process has terminated. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
11a3318c02
commit
cd0bc57ca8
1 file changed
+6
-1
+6
-1
@@ -1373,10 +1373,15 @@ restart:
|
|||||||
|
|
||||||
case SVC_STOPPING_STATE:
|
case SVC_STOPPING_STATE:
|
||||||
if (!svc->pid) {
|
if (!svc->pid) {
|
||||||
|
char cond[MAX_COND_LEN];
|
||||||
|
|
||||||
/* PID was collected normally, no need to kill it */
|
/* PID was collected normally, no need to kill it */
|
||||||
_d("%s: Stopped normally, no need to send SIGKILL :)", svc->cmd);
|
_d("%s: stopped normally, no need to send SIGKILL :)", svc->cmd);
|
||||||
service_timeout_cancel(svc);
|
service_timeout_cancel(svc);
|
||||||
|
|
||||||
|
_d("%s: clearing pid condition ...", svc->name);
|
||||||
|
cond_clear(mkcond(svc, cond, sizeof(cond)));
|
||||||
|
|
||||||
switch (svc->type) {
|
switch (svc->type) {
|
||||||
case SVC_TYPE_SERVICE:
|
case SVC_TYPE_SERVICE:
|
||||||
svc_set_state(svc, SVC_HALTED_STATE);
|
svc_set_state(svc, SVC_HALTED_STATE);
|
||||||
|
|||||||
Reference in new issue
Block a user