Fix #314: skip restart if conditions are lost

This change prevents Finit from attempting to continue restarting
crashing services that've lost their conditions.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-11-15 01:03:10 +01:00
1 parent 2a7abf1db0
commit 8b9bb1c7ce
2 files changed
+7

No files matched your search

+6
View File
@@ -270,6 +270,12 @@ int cond_update(const char *name)
affects++;
dbg("%s: match <%s> %s(%s)", name ?: "nil", svc->cond, svc->desc, svc->cmd);
/* Fix bug #314: race condition between crashing services and conditions */
if (svc_is_restart(svc) && cond_get_agg(svc->cond) == COND_OFF) {
dbg("%s: cancel timer & unblock => WAITING state.", name ?: "nil");
service_timeout_cancel(svc);
svc_unblock(svc);
}
service_step(svc);
}