[SOLVED BUG]: ntpd startup fails after update today
I updated everything on an x86_64 machine today. After restart I find one daemon fails to start properly.
I use runit and ntp-runit looks like
#!/bin/sh
# Thanks to replabrobin for the network check!
[ "$(ip route | awk '/^default/{print ($3!="")+($5!="")}')" = "2" ] || exit 1
exec ntpd -g -u ntp:ntp -n >/dev/null 2>&1
It seems like I have new behaviour from the network check. If I have both eth0 and wlan0 connected then the route awk combo gives two lines of output and the check fails. I suspect that previously a timing difference allowed the guard to succeed ie perhaps eth0 was faster. To accommodate multiple default routes I changed my run command to
#!/bin/sh
# Thanks to replabrobin for the network check!
[ "$(ip route | awk '/^default/{if(($3!="")+($5!="")==2){print "2";exit 0;}}')" = "2" ] || exit 1
exec ntpd -g -u ntp:ntp -n >/dev/null 2>&1
the guard exits after the first default that is good.