* FHS compliance: put persistent state in /var/lib, not /var/state.

svn path=/nixos/trunk/; revision=8377
This commit is contained in:
Eelco Dolstra 2007-03-20 11:04:45 +00:00
parent 9e9d6a4c62
commit 4f3b2290b2
3 changed files with 16 additions and 4 deletions

View File

@ -2,7 +2,7 @@
let
soundState = "/var/state/asound.state";
soundState = "/var/lib/alsa/asound.state";
in
@ -17,6 +17,8 @@ stop on shutdown
start script
mkdir -m 0755 -p $(dirname ${soundState})
# Load some additional modules.
for mod in snd_pcm_oss; do
${modprobe}/sbin/modprobe $mod || true

View File

@ -6,6 +6,8 @@ let
ignoredInterfaces = ["lo"] ++
map (i: i.name) (lib.filter (i: i ? ipAddress) interfaces);
stateDir = "/var/lib/dhcp"; # Don't use /var/state/dhcp; not FHS-compliant.
in
{
@ -37,9 +39,9 @@ script
exit 1
fi
mkdir -m 755 -p /var/state/dhcp
mkdir -m 755 -p ${stateDir}
exec ${dhcp}/sbin/dhclient -d $interfaces -e \"PATH=$PATH\"
exec ${dhcp}/sbin/dhclient -d $interfaces -e \"PATH=$PATH\" -lf ${stateDir}/dhclient.leases
end script
";

View File

@ -1,5 +1,11 @@
{dhcp, configFile, interfaces}:
let
stateDir = "/var/lib/dhcp"; # Don't use /var/state/dhcp; not FHS-compliant.
in
{
name = "dhcpd";
@ -10,7 +16,9 @@ start on network-interfaces/started
stop on network-interfaces/stop
script
exec ${dhcp}/sbin/dhcpd -f -cf ${configFile} ${toString interfaces}
exec ${dhcp}/sbin/dhcpd -f -cf ${configFile} \\
-lf ${stateDir}/dhcpd.leases \\
${toString interfaces}
end script
";