mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-07 14:00:59 +03:00
* 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:
parent
9a09051f4b
commit
aca8225e3b
@ -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
|
||||
|
@ -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";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user