* NSCD daemon.

svn path=/nixos/trunk/; revision=7645
This commit is contained in:
Eelco Dolstra 2007-01-11 23:55:25 +00:00
parent 5acc5f6e28
commit 9963b263d3
3 changed files with 61 additions and 0 deletions

View File

@ -76,6 +76,11 @@ import ../upstart-jobs/gather.nix {
inherit (pkgs) cron;
})
# Name service cache daemon.
(import ../upstart-jobs/nscd.nix {
inherit (pkgs) glibc pwdutils;
})
# Handles the maintenance/stalled event (single-user shell).
(import ../upstart-jobs/maintenance-shell.nix {
inherit (pkgs) bash;

27
upstart-jobs/nscd.conf Normal file
View File

@ -0,0 +1,27 @@
server-user nscd
paranoia no
debug-level 0
enable-cache passwd yes
positive-time-to-live passwd 600
negative-time-to-live passwd 20
suggested-size passwd 211
check-files passwd yes
persistent passwd yes
shared passwd yes
enable-cache group yes
positive-time-to-live group 3600
negative-time-to-live group 60
suggested-size group 211
check-files group yes
persistent group yes
shared group yes
enable-cache hosts yes
positive-time-to-live hosts 600
negative-time-to-live hosts 5
suggested-size hosts 211
check-files hosts yes
persistent hosts no
shared hosts yes

29
upstart-jobs/nscd.nix Normal file
View File

@ -0,0 +1,29 @@
{glibc, pwdutils}:
{
name = "nscd";
job = "
description \"Name Service Cache Daemon\"
start on startup
stop on shutdown
start script
if ! ${glibc}/bin/getent passwd nscd > /dev/null; then
${pwdutils}/sbin/useradd -g nogroup -d /var/empty -s /noshell \\
-c 'Name service cache daemon user' nscd
fi
mkdir -m 0755 -p /var/run/nscd
mkdir -m 0755 -p /var/db/nscd
end script
# !!! -d turns on debug info which probably makes nscd slower
# 2>/dev/null is to make it shut up
respawn ${glibc}/sbin/nscd -f ${./nscd.conf} -d 2> /dev/null
";
}