--- dhcpd.init 2007-04-02 14:35:53.000000000 +0200 +++ dhcpd.init.new 2009-04-16 03:05:44.000000000 +0200 @@ -3,7 +3,14 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init,v 1.5 2007/04/02 12:34:01 uberlord Exp $ -DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd.conf} +DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/${SVCNAME}.conf} +if [ "$(sed 's/[^6]*//' <<< "${SVCNAME}")" == "6" ] ; then + DHCPD_OPTS="${DHCPD_OPTS} -6" + einfo "y" +else + DHCPD_OPTS="${DHCPD_OPTS} -4" + einfo "n" +fi depend() { need net @@ -33,7 +40,7 @@ fi local leasefile="$(get_var lease-file-name)" - leasefile="${DHCPD_CHROOT}/${leasefile:-/var/lib/dhcp/dhcpd.leases}" + leasefile="${DHCPD_CHROOT}/${leasefile:-/var/lib/dhcp/${SVCNAME}.leases}" if [ ! -f "${leasefile}" ] ; then ebegin "Creating ${leasefile}" touch "${leasefile}" @@ -48,13 +55,13 @@ fi local pidfile="$(get_var pid-file-name)" - pidfile="${pidfile:-/var/run/dhcp/dhcpd.pid}" + pidfile="${pidfile:-/var/run/dhcp/${SVCNAME}.pid}" ebegin "Starting ${DHCPD_CHROOT:+chrooted }${SVCNAME}" start-stop-daemon --start --exec /usr/sbin/dhcpd \ --pidfile "${DHCPD_CHROOT}/${pidfile}" \ -- ${DHCPD_OPTS} -q -pf "${pidfile}" \ - -user dhcp -group dhcp \ + -user dhcp -group dhcp -lf "${leasefile}" \ ${DHCPD_CHROOT:+-chroot} ${DHCPD_CHROOT} ${DHCPD_IFACE} eend $? \ && save_options chroot "${DHCPD_CHROOT}" \