Support s6 service startup notification

This can be enabled via the s6-notify configure option; see
http://www.skarnet.org/software/s6/notifywhenup.html for details.

ndhc will signal that it is ready when the first valid lease is
obtained.  Programs dependent on a working network interface
can then simply use s6-wait on the associated ndhc service dir.

A typical command line option assuming the s6 service directory
notification-fd contains '3' would be '--s6-notify 3', and
a typical configure file option would be 's6-notify 3'.
This commit is contained in:
Nicholas J. Kain
2022-02-12 16:31:39 -05:00
parent d67e1599df
commit 2fb16567f1
6 changed files with 1493 additions and 991 deletions

1
ndhc.c
View File

@ -59,6 +59,7 @@ struct client_state_t cs = {
struct client_config_t client_config = {
.interface = "eth0",
.arp = "\0\0\0\0\0\0",
.s6_notify_fd = 3,
.clientid_len = 0,
.metric = 0,
};