From 116306c8dc1a91f2cfe6f579e7fe6081940aac14 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 2 Jun 2009 19:42:31 +0000 Subject: [PATCH] * Restart ntpd when we get a new DHCP lease. Without this, if ntpd previously failed to resolve the NTP server hostnames in its config file, it will happily sit in a loop forever doing nothing. svn path=/nixos/branches/modular-nixos/; revision=15830 --- modules/services/networking/dhclient.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/services/networking/dhclient.nix b/modules/services/networking/dhclient.nix index 39c93860bfec..c409077ddc47 100644 --- a/modules/services/networking/dhclient.nix +++ b/modules/services/networking/dhclient.nix @@ -60,6 +60,15 @@ let if test "$reason" = BOUND -o "$reason" = REBOOT; then ${pkgs.glibc}/sbin/nscd --invalidate hosts + + # Restart ntpd. (The "ip-up" event below will trigger the + # restart.) We need to restart it to make sure that it will + # actually do something: if ntpd cannot resolve the server + # hostnames in its config file, then it will never do + # anything ever again ("couldn't resolve ..., giving up on + # it"), so we silently lose time synchronisation. + ${pkgs.upstart}/sbin/initctl stop ntpd + ${pkgs.upstart}/sbin/initctl emit ip-up fi