--- dhcpd.orig 2011-04-07 22:41:33.000000000 +0400 +++ dhcpd 2011-04-08 01:36:27.000000000 +0400 @@ -14,7 +14,7 @@ get_var() { sed -n 's/^[[:blank:]]\?'"$1"' "*\([^#";]\+\).*/\1/p' \ - "${DHCPD_CHROOT}/${DHCPD_CONF}" + "${DHCPD_CONF}" } checkconfig() { @@ -46,8 +46,8 @@ ;; esac - if [ ! -f "${DHCPD_CHROOT}/${DHCPD_CONF}" ] ; then - eerror "${DHCPD_CHROOT}/${DHCPD_CONF} does not exist" + if [ ! -f "${DHCPD_CONF}" ] ; then + eerror "${DHCPD_CONF} does not exist" return 1 fi @@ -68,6 +68,7 @@ if [ -n "${DHCPD_CHROOT}" ] ; then LD_PRELOAD="${LD_PRELOAD} /usr/lib/libresolv.so" export LD_PRELOAD="${LD_PRELOAD} /usr/lib/libnss_dns.so" + mount --bind /proc "${DHCPD_CHROOT}/proc" fi local pidfile="$(get_var pid-file-name)" @@ -90,5 +91,10 @@ ebegin "Stopping ${chroot:+chrooted }${SVCNAME}" start-stop-daemon --stop --exec /usr/sbin/dhcpd \ --pidfile "${chroot}/$(get_options pidfile)" - eend $? + res=$? + + if [ -n "${DHCPD_CHROOT}" ] ; then + umount "${DHCPD_CHROOT}/proc" + fi + eend $res }