mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
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:
+2
-5
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user