Do not create PID conditions for services that do not support it

Follow-up to issue #386

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-11-13 04:37:03 +01:00
parent 47b0d4cccf
commit 66020f48ea
2 changed files with 9 additions and 5 deletions
+4
View File
@@ -80,6 +80,10 @@ 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);
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));
if (mask & (IN_CLOSE_WRITE | IN_ATTRIB | IN_MODIFY | IN_MOVED_TO)) {
+5 -5
View File
@@ -23,11 +23,11 @@ service nowarn [S12345789] cgroup.system name:udevd notify:none pid:udevd log ud
# Wait for udevd to start, then trigger coldplug events and module loading.
# The last 'settle' call waits for it to finalize processing all uevents.
run nowarn if:udevd cgroup.init :1 [S] <pid/udevd> log udevadm settle -t 0 --
run nowarn if:udevd cgroup.init :2 [S] <pid/udevd> log udevadm control --reload --
run nowarn if:udevd cgroup.init :3 [S] <pid/udevd> log udevadm trigger -c add -t devices -- Requesting device events
run nowarn if:udevd cgroup.init :4 [S] <pid/udevd> log udevadm trigger -c add -t subsystems -- Requesting subsystem events
run nowarn if:udevd cgroup.init :5 [S] <pid/udevd> log udevadm settle -t 30 -- Waiting for udev to finish
run nowarn if:udevd cgroup.init :1 [S] <service/udevd/ready> log udevadm settle -t 0 --
run nowarn if:udevd cgroup.init :2 [S] <service/udevd/ready> log udevadm control --reload --
run nowarn if:udevd cgroup.init :3 [S] <service/udevd/ready> log udevadm trigger -c add -t devices -- Requesting device events
run nowarn if:udevd cgroup.init :4 [S] <service/udevd/ready> log udevadm trigger -c add -t subsystems -- Requesting subsystem events
run nowarn if:udevd cgroup.init :5 [S] <service/udevd/ready> log udevadm settle -t 30 -- Waiting for udev to finish
# If udevd is not available, check for mdevd. Unlike plain 'mdev -df', the
# mdevd-coldplug process exits when mdevd has completed. So the condition