Skip to content

Commit

Permalink
Do not create PID conditions for services that do not support it
Browse files Browse the repository at this point in the history
Follow-up to issue #386

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Nov 13, 2023
1 parent 47b0d4c commit 66020f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions plugins/pidfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
10 changes: 5 additions & 5 deletions system/10-hotplug.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66020f4

Please sign in to comment.