mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
keventd: defer pidfile until coldplug queue is drained
When started with -c (the default when keventd is the device manager), gate the pidfile on the kernel's uevent_seqnum having been stable for 200ms. Up to now ready signaling with the pidfile was done right after coldplug() triggered the kernel to re-emit events, but before uev_run() had drained any of them, so <pid/keventd> really only meant "listening on netlink". With the gate, services that depend on <pid/keventd> can now assume /dev is populated and persistent symlinks are live. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
3 files changed
+93
-11
No files matched your search
@@ -41,6 +41,13 @@ texec initctl reload >/dev/null \
|
||||
|| fail "initctl reload returned non-zero"
|
||||
assert "initctl reload ok" 0 -eq 0
|
||||
|
||||
# keventd was restarted above and only writes its pidfile once the
|
||||
# coldplug queue has drained, so <pid/keventd> asserts a good while
|
||||
# after the restart returns. Let it land before subscribing below,
|
||||
# or the monitor catches keventd's ConditionChanged instead of ours
|
||||
# and stops, since it waits for exactly one signal.
|
||||
retry 'assert_cond pid/keventd' 100 0.1
|
||||
|
||||
# A ConditionChanged signal can only originate from Cond1.Set going
|
||||
# through finit (the legacy filesystem path doesn't emit signals).
|
||||
# So if the monitor sees one, we know initctl cond set was routed
|
||||
|
||||
Reference in new issue
Block a user