mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-04 06:42:33 +03:00
* In the jobs attribute, support a more high-level way of specifying
jobs, e.g. (from the nscd job) { name = "nscd"; description = "Name Service Cache Daemon"; startOn = "startup"; stopOn = "shutdown"; environment = { LD_LIBRARY_PATH = nssModulesPath; }; preStart = '' mkdir -m 0755 -p /var/run/nscd mkdir -m 0755 -p /var/db/nscd ''; exec = "${pkgs.glibc}/sbin/nscd -f ${./nscd.conf} -d 2> /dev/null"; }; The Upstart job is generated from this. The main goal is to provide some abstraction from the Upstart syntax. For instance, this should make it easier to upgrade to newer versions of Upstart, to switch to an entirely different process management system (e.g. initng or launchd), or to test a job independantly from Upstart. (However the startOn and stopOn attributes are tied to Upstart's event model.) svn path=/nixos/branches/modular-nixos/; revision=16376
This commit is contained in:
parent
0e3bef4195
commit
c45cf3a28e
2 changed files with 102 additions and 33 deletions
|
@ -17,31 +17,24 @@ in
|
|||
description = "Name service cache daemon user";
|
||||
};
|
||||
|
||||
jobs = singleton {
|
||||
name = "nscd";
|
||||
jobs = singleton
|
||||
{ name = "nscd";
|
||||
|
||||
description = "Name Service Cache Daemon";
|
||||
|
||||
startOn = "startup";
|
||||
stopOn = "shutdown";
|
||||
|
||||
environment = { LD_LIBRARY_PATH = nssModulesPath; };
|
||||
|
||||
job = ''
|
||||
description \"Name Service Cache Daemon\"
|
||||
|
||||
start on startup
|
||||
stop on shutdown
|
||||
|
||||
env LD_LIBRARY_PATH=${nssModulesPath}
|
||||
|
||||
start script
|
||||
|
||||
preStart =
|
||||
''
|
||||
mkdir -m 0755 -p /var/run/nscd
|
||||
mkdir -m 0755 -p /var/db/nscd
|
||||
'';
|
||||
|
||||
rm -f /var/db/nscd/* # for testing
|
||||
|
||||
end script
|
||||
|
||||
# !!! -d turns on debug info which probably makes nscd slower
|
||||
# 2>/dev/null is to make it shut up
|
||||
respawn ${pkgs.glibc}/sbin/nscd -f ${./nscd.conf} -d 2> /dev/null
|
||||
'';
|
||||
};
|
||||
exec = "${pkgs.glibc}/sbin/nscd -f ${./nscd.conf} -d 2> /dev/null";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue