2007-03-16 16:41:38 +00:00
|
|
|
{dhcp, configFile, interfaces}:
|
|
|
|
|
2007-03-20 11:04:45 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
stateDir = "/var/lib/dhcp"; # Don't use /var/state/dhcp; not FHS-compliant.
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2007-03-16 16:41:38 +00:00
|
|
|
{
|
|
|
|
name = "dhcpd";
|
|
|
|
|
|
|
|
job = "
|
|
|
|
description \"DHCP server\"
|
|
|
|
|
|
|
|
start on network-interfaces/started
|
|
|
|
stop on network-interfaces/stop
|
|
|
|
|
|
|
|
script
|
2007-03-20 12:34:52 +00:00
|
|
|
|
|
|
|
mkdir -m 755 -p ${stateDir}
|
|
|
|
|
|
|
|
touch ${stateDir}/dhcpd.leases
|
|
|
|
|
2007-03-20 11:04:45 +00:00
|
|
|
exec ${dhcp}/sbin/dhcpd -f -cf ${configFile} \\
|
|
|
|
-lf ${stateDir}/dhcpd.leases \\
|
|
|
|
${toString interfaces}
|
2007-03-20 12:34:52 +00:00
|
|
|
|
2007-03-16 16:41:38 +00:00
|
|
|
end script
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|