Fix type:forking regression in 66020f4, caught by tests

Premise, a service declaring itself 'notify:none' should never assert a
pid condition.  However, forking services still need to be supported and
the only way to do that is if they create a pid file.  Hence, instead of
skipping pidfile_update_conds() completely we need to filter the type.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-11-13 06:06:58 +01:00
parent dc3ee9e467
commit e60211168e
+2 -5
View File
@@ -80,10 +80,6 @@ static void pidfile_update_conds(char *dir, char *name, uint32_t mask)
} }
dbg("Found svc %s for %s with pid %d", svc_ident(svc, NULL, 0), fn, svc->pid); dbg("Found svc %s for %s with pid %d", svc_ident(svc, NULL, 0), fn, svc->pid);
if (svc->notify != SVC_NOTIFY_PID) {
dbg("svc %s does not use PID readiness notification, skipping.", svc_ident(svc, NULL, 0));
return;
}
mkcond(svc, cond, sizeof(cond)); mkcond(svc, cond, sizeof(cond));
if (mask & (IN_CLOSE_WRITE | IN_ATTRIB | IN_MODIFY | IN_MOVED_TO)) { if (mask & (IN_CLOSE_WRITE | IN_ATTRIB | IN_MODIFY | IN_MOVED_TO)) {
@@ -124,8 +120,9 @@ static void pidfile_update_conds(char *dir, char *name, uint32_t mask)
} }
} }
cond_set(cond);
if (svc->notify == SVC_NOTIFY_PID) if (svc->notify == SVC_NOTIFY_PID)
cond_set(cond);
if (svc->notify == SVC_NOTIFY_PID || svc->notify == SVC_NOTIFY_NONE)
service_ready(svc); service_ready(svc);
} else if (mask & IN_DELETE) { } else if (mask & IN_DELETE) {
cond_clear(cond); cond_clear(cond);