dhcpcd.nix: Go into the background and restart ntpd

This commit is contained in:
Eelco Dolstra 2012-07-20 18:24:55 -04:00
parent ee075bdf6b
commit 7a98c884f8

View File

@ -51,20 +51,19 @@ let
''} ''}
if [ "$reason" = BOUND -o "$reason" = REBOOT ]; then if [ "$reason" = BOUND -o "$reason" = REBOOT ]; then
# Restart ntpd. (The "ip-up" event below will trigger the # Restart ntpd. We need to restart it to make sure that it
# restart.) We need to restart it to make sure that it will # will actually do something: if ntpd cannot resolve the
# actually do something: if ntpd cannot resolve the server # server hostnames in its config file, then it will never do
# hostnames in its config file, then it will never do
# anything ever again ("couldn't resolve ..., giving up on # anything ever again ("couldn't resolve ..., giving up on
# it"), so we silently lose time synchronisation. # it"), so we silently lose time synchronisation.
${config.system.build.upstart}/sbin/initctl stop ntpd ${config.system.build.systemd}/bin/systemctl restart ntpd.service
${config.system.build.upstart}/sbin/initctl emit -n ip-up $params #${config.system.build.upstart}/sbin/initctl emit -n ip-up $params
fi fi
if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then #if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then
${config.system.build.upstart}/sbin/initctl emit -n ip-down $params # ${config.system.build.upstart}/sbin/initctl emit -n ip-down $params
fi #fi
''; '';
in in
@ -97,7 +96,9 @@ in
path = [ dhcpcd pkgs.nettools pkgs.openresolv ]; path = [ dhcpcd pkgs.nettools pkgs.openresolv ];
exec = "dhcpcd --config ${dhcpcdConf} --nobackground"; daemonType = "fork";
exec = "dhcpcd --config ${dhcpcdConf}";
}; };
environment.systemPackages = [ dhcpcd ]; environment.systemPackages = [ dhcpcd ];