* Invalidate the nscd hosts cache when an "ip-up" event occurs. This

event is emitted by dhclient and by the network-interfaces job in
  case of statically configured interfaces.  Invalidating the cache is
  necessary to get rid of negative queries.

svn path=/nixos/trunk/; revision=31779
This commit is contained in:
Eelco Dolstra 2012-01-21 19:13:43 +00:00
parent 9a09051f4b
commit aca8225e3b
2 changed files with 10 additions and 2 deletions

View File

@ -20,8 +20,6 @@ let
#echo "$exit_status" >> /tmp/dhcp-exit
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

View File

@ -57,5 +57,15 @@ in
exec = "nscd -f ${./nscd.conf} -d 2> /dev/null";
};
# Flush nscd's hosts database when the network comes up to get
# rid of any negative entries.
jobs.invalidate_nscd =
{ name = "invalidate-nscd";
description = "Invalidate NSCD cache";
startOn = "ip-up";
task = true;
exec = "${pkgs.glibc}/sbin/nscd --invalidate hosts";
};
};
}