You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
race condition with systemd notification protocol #505
Could you give an example to help me understand? Because often the call to sd_notify(), or pidfile creation, is actually malplaced in the daemon itself.
imagine a daemon tries to access NOTIFY_SOCKET before it does anything else... since finit forks the process first it would be possible that the socket isn't bound yet...
i have a user running systemd-udev in their initramfs and they weren't getting a ready condition for the daemon... we ended up creating a script to test this out...
#!/bin/sh
if [ -n "''${NOTIFY_SOCKET:-}" ]; then
found=
tries=0
while [ -z "$found" ] && [ "$tries" -lt 100000 ]; do
while read -r _ _ _ _ _ _ _ name; do
if [ "$name" = "$NOTIFY_SOCKET" ]; then
found=1
break
fi
done < /proc/net/unix
tries=$((tries + 1))
done
fi
exec "$@"
Activity
troglobit commentedon Sep 14, 2026
Could you give an example to help me understand? Because often the call to
sd_notify(), or pidfile creation, is actually malplaced in the daemon itself.aanderse commentedon Sep 15, 2026
imagine a daemon tries to access
NOTIFY_SOCKETbefore it does anything else... sincefinitforks the process first it would be possible that the socket isn't bound yet...i have a user running
systemd-udevin their initramfs and they weren't getting areadycondition for the daemon... we ended up creating a script to test this out...the
commandwas that script followed by callingudevand this fixed the issue for themi ended up creating a vm test to reproduce and was able to... in some cases i got up to
1158tries before the name appearednote that we have only been able to reproduce this in an initramfs so far
troglobit commentedon Sep 16, 2026
Aha, got it! I'll see what my friend can make of it while we await review on #500 (stalling my pipeline atm :)