--- dhcp.init 2005-12-14 21:06:13.000000000 +0000 +++ /etc/init.d/dhcp 2006-02-20 11:26:18.000000000 +0000 @@ -19,7 +19,7 @@ return 1 fi - local leasefile=$(get_var lease-file-name) + local leasefile="$(get_var lease-file-name)" leasefile="${leasefile:-${CHROOT}/var/lib/dhcp/dhcpd.leases}" if [[ ! -f ${leasefile} ]] ; then ebegin "Creating ${leasefile}" @@ -35,17 +35,19 @@ pidfile="${pidfile:-/var/run/dhcp/dhcp.pid}" ebegin "Starting ${CHROOT:+chrooted }dhcpd" - eval start-stop-daemon --start --exec /usr/sbin/dhcpd \ - --pidfile "${CHROOT}${pidfile}" \ + start-stop-daemon --start --exec /usr/sbin/dhcpd \ + --pidfile "${CHROOT}/${pidfile}" \ -- -q -pf "${pidfile}" \ - -user dhcp -group dhcp "${DHCPD_OPTS}" \ - ${CHROOT:+-chroot "${CHROOT}"} "${IFACE}" - eend $? && save_options pidfile "${CHROOT}${pidfile}" + -user dhcp -group dhcp ${DHCPD_OPTS} \ + ${CHROOT:+-chroot} "${CHROOT}" ${IFACE} + eend $? && save_options pidfile "${CHROOT}/${pidfile}" } stop() { - ebegin "Stopping dhcpd" + local pidfile="$(get_options pidfile)" chrooted="" + [[ ${pidfile} != /var/run/dhcp/dhcp.pid ]] && chrooted="chrooted " + ebegin "Stopping ${chrooted}dhcpd" start-stop-daemon --stop --exec /usr/sbin/dhcpd \ - --pidfile "$(get_options pidfile)" + --pidfile "${pidfile}" eend $? }