commit de1ccf138e27d0e232c9b3b115fbf86d7160f07d
parent d0376d41016e0ddbd532b63f7fd3b2f4fcbcdf37
Author: Peter Collingbourne <peter@pcc.me.uk>
Date: Sun, 3 May 2026 00:18:03 -0700
Fix race between lease-acquired and dependent services
We use s6-rc-up-tree to bring up all services depending on lease-acquired,
but there's a race between copying the lease information into the
lease-acquired service directory and dependent services reading from
the service directory. Fix it by using the notification-fd mechanism to
notify s6 when the files are copied.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/modules/dhcp4c/client.nix b/modules/dhcp4c/client.nix
@@ -80,7 +80,9 @@ longrun {
(in_outputs ${controlled-name}
cp $(output_path ${service})/* .
)
+ echo > /proc/self/fd/10
while sleep 86400 ; do true ; done
'';
controller = watcher;
+ notification-fd = 10;
}