Rewrite chroot usage to work with newer versions #362535 by Andrew Savchenko.
authorMike Frysinger <vapier@gentoo.org>
Sat, 17 Sep 2011 05:28:58 +0000 (05:28 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 17 Sep 2011 05:28:58 +0000 (05:28 +0000)
Package-Manager: portage-2.2.0_alpha58/cvs/Linux x86_64

net-misc/dhcp/ChangeLog
net-misc/dhcp/Manifest
net-misc/dhcp/dhcp-4.2.2-r2.ebuild [new file with mode: 0644]
net-misc/dhcp/files/dhcpd.conf2 [new file with mode: 0644]
net-misc/dhcp/files/dhcpd.init4 [new file with mode: 0755]

index e59778ab3b903745c4d922a5da65009fdd33d704..fb8f2cb52a22d735361d51b156c17e26eaec32d3 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for net-misc/dhcp
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.186 2011/08/29 22:40:59 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.187 2011/09/17 05:28:58 vapier Exp $
+
+*dhcp-4.2.2-r2 (17 Sep 2011)
+
+  17 Sep 2011; Mike Frysinger <vapier@gentoo.org> +dhcp-4.2.2-r2.ebuild,
+  +files/dhcpd.conf2, +files/dhcpd.init4:
+  Rewrite chroot usage to work with newer versions #362535 by Andrew Savchenko.
 
   29 Aug 2011; Mike Frysinger <vapier@gentoo.org>
   files/dhcp-4.2.2-bind-build-flags.patch:
index 39094c37d161cbb92ff9ad84cf31472f5e01cd95..cf762769c73a0a9221f703642527772e6612842c 100644 (file)
@@ -29,8 +29,10 @@ AUX dhcp-4.2.2-dhclient-resolvconf.patch 14535 RMD160 7527ea3e52a6913ae3ba2d8a6e
 AUX dhcp-4.2.2-dhclient-stdin-conf.patch 3017 RMD160 9d43cb04b50ca91c680b195eb33ca68c2d06a2a7 SHA1 5ceb5ea6ec3c444df14c04585ff1482ffe8b9e35 SHA256 701da4d022490bf9e1cfd946c752a00a2d2ab9a1fd5030281c1608f367cc68fe
 AUX dhcp-4.2.2-nogateway.patch 1671 RMD160 bf401172a4c379f4c51c7afcd912c3e7faef6140 SHA1 1a82353a031d49ecc27441bbb9640de9e6ff5530 SHA256 3fed5823812c134e1819c8ac10c5fc718df86f4013ffc7505efbbe692319480e
 AUX dhcpd.conf 1092 RMD160 936bb112c7cdf8e669b695599252d1f6626be2f3 SHA1 cbabbcea73a0cbc9692462683b983c96d6f18b0c SHA256 b86d27e0560689057b01a352474582fceb3a398eaf3b17f901378ec56284c4d5
+AUX dhcpd.conf2 1100 RMD160 92d7fa24ddedf568fd4eaab2c9f49cf17c7d89ea SHA1 37a41582b3506af2c24d29a9f659c62b579a6d18 SHA256 431cf602f9be36475e296cde7efba7e3e8d5f05b61558dbd2ac28ff8c4e84150
 AUX dhcpd.init2 2421 RMD160 baa01ae97b227edba7653cd51735613be2dac652 SHA1 f2068ceb2d79d7992f46b31e6a6e3277a0167dce SHA256 fef93e5a7264780044a977ade27e9cc70de824063791bcd07d3db81c11c16df5
 AUX dhcpd.init3 2525 RMD160 d56c77e6f2e3981c78c3fefad04347615e9d9d60 SHA1 c04f470d0cc3b262cf87cc766ceee5a35aec8b43 SHA256 69f5e6bee391a9a03554bead07c9dd5775e1fbb2a0ae515b7930cec328a8959c
+AUX dhcpd.init4 2892 RMD160 7f8684f6ae32fded0aee6e8b499266d71cda2572 SHA1 65e8daa6529f892e36e246d131ecd4057cb016f2 SHA256 b573cf0fe9cf2f48b544901603bae78cf173757dae02212b1d88c60c3d89625e
 AUX dhcrelay.conf 421 RMD160 456edbc9bcc8d3a44db5bb6dbf0c3003c3e7419c SHA1 78ecdb000382893fb49d0052ced063955b0ad9cf SHA256 409b895ed489e75c1a08f72961b45d641b93fd9357f528abc78b1fd036b7f730
 AUX dhcrelay.init 736 RMD160 04566b87bd6dbb8bb754b26409ca30b878ef3ca3 SHA1 72742b308314b2e1476b27e94212fbf4d179adc4 SHA256 cfdaff3a723be3935d06c14e171d4008f2ad3329bd05ac2e49c19bc0e14bc59c
 AUX dhcrelay.init2 712 RMD160 2baeaf7c0fb8a5796792b5721f32104907243798 SHA1 ced20da5625b6517fa6044ce179e1c5d9a17297e SHA256 6cca726147474c600662b0c2e49eb5aa148a7a9af1358dbc56f16b1d08255ae3
@@ -42,13 +44,14 @@ EBUILD dhcp-3.1.2_p1.ebuild 7582 RMD160 d7f42417b80f9f17e0c8c217c978707506802a22
 EBUILD dhcp-3.1.3_p1.ebuild 7741 RMD160 62ef4cf524beadef2847675416ea5982f23a3f8e SHA1 3995b5c53d6b11fde440cf43c0dacac31f084d72 SHA256 7a71c86e1685858826a09f28dff77d69a98ec1d37c93bbb6e4dd216af00ce96c
 EBUILD dhcp-4.2.1_p1.ebuild 6610 RMD160 0d058e755de185a58fc62a3d047021671de9a54a SHA1 5cf96d94250ba44b3120ae6a961c04e4f01996b5 SHA256 70534d654d5a2d02ea009d87f77bf86724ee94b7587f5b6959eef90475e5062a
 EBUILD dhcp-4.2.2-r1.ebuild 7894 RMD160 13f3a4e2a9ea39fbd76dd6e6b2fd0794643a86c9 SHA1 0495e7fc318b19242a61e78b6179ff61700e7d99 SHA256 6787973217634489e3e45e67c212ff60ce80bd721a198cf3348b2961ddd17e8e
+EBUILD dhcp-4.2.2-r2.ebuild 6698 RMD160 d957fe323bad82c00677d0f55065716b2bcac12c SHA1 f1f523f62cfd7ce347057431771d191963c837b2 SHA256 4f549da39007a18926f6853eec748db8be1ac5e66bacb9434c6b8adc9972777f
 EBUILD dhcp-4.2.2.ebuild 7474 RMD160 a80b1fb2eb31ba8dc20f9d6fb914e37a5cf12174 SHA1 089b6bb9e87f07c950d7ee4261e081ba59f29fa5 SHA256 9f15f5b2d35d9ff4372250886f3751b94abb0fbebc99ea4d16e5abd74ccf9755
-MISC ChangeLog 32168 RMD160 bbdea981251006a6c0014e77cebc2fd69c44cc80 SHA1 46361d320b870487e5957add3c00226ce9a43e3d SHA256 27757411a8a353e3aef883c060c6cec97f4d71efe308d927b3cf73520be154ee
+MISC ChangeLog 32394 RMD160 340c2b7591672a444e166ce46c6d788981069b2d SHA1 a7586fd40d88ae48e0710191499c030b06ba2a68 SHA256 8ca0decbbdfb43486dec3d468083daab395282c0b3075a81f751f6784ba93257
 MISC metadata.xml 500 RMD160 b5ad909ab2b12acd20e78039e33fda0a27383c9e SHA1 2fc5cee8e105e75a251195254c96085a0f3fa9a3 SHA256 e9e4edcf7671391ee2f2af0917a75fc07883f1401aaa22b72dd0133bef81601c
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.17 (GNU/Linux)
 
-iF4EAREIAAYFAk5cFXYACgkQaC/OocHi7JbTHgD/Xdo4ohLwtNmX9EDRUvRUp828
-SA+PMul9S1gk6f+6vowA/ResgwE87fnlOh4eZrTsfPXnEE8qbzum/uJor/Ayuz26
-=2Wt1
+iF4EAREIAAYFAk50MCAACgkQaC/OocHi7JYdWgD+J899XRRy9awIFhYlq6SXM6dK
+I3n7K2kJ9glAerqCdL0A/24QcPg279BzYGR7S6hUq4/LfdTaF8U2DwIcFU6jZ0pX
+=wZ8f
 -----END PGP SIGNATURE-----
diff --git a/net-misc/dhcp/dhcp-4.2.2-r2.ebuild b/net-misc/dhcp/dhcp-4.2.2-r2.ebuild
new file mode 100644 (file)
index 0000000..bd57055
--- /dev/null
@@ -0,0 +1,223 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.2.2-r2.ebuild,v 1.1 2011/09/17 05:28:58 vapier Exp $
+
+EAPI="2"
+
+inherit eutils toolchain-funcs
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_PV="${MY_PV//_p/-P}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
+HOMEPAGE="http://www.isc.org/products/DHCP"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz"
+
+LICENSE="as-is BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="+client ipv6 kernel_linux ldap selinux +server ssl vim-syntax"
+
+DEPEND="selinux? ( sec-policy/selinux-dhcp )
+       kernel_linux? ( sys-apps/net-tools )
+       ldap? (
+               net-nds/openldap
+               ssl? ( dev-libs/openssl )
+       )"
+RDEPEND="${DEPEND}
+       vim-syntax? ( app-vim/dhcpd-syntax )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+       unpack ${A}
+       # handle local bind hell
+       cd "${S}"/bind
+       unpack ./bind.tar.gz
+}
+
+src_prepare() {
+       # Gentoo patches - these will probably never be accepted upstream
+       # Fix some permission issues
+       epatch "${FILESDIR}"/${PN}-3.0-fix-perms.patch
+       # Enable dhclient to equery NTP servers
+       epatch "${FILESDIR}"/${PN}-4.0-dhclient-ntp.patch
+       # resolvconf support in dhclient-script
+       epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-resolvconf.patch
+       # Stop downing the interface on Linux as that breaks link daemons
+       # such as wpa_supplicant and netplug
+       epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-no-down.patch
+       epatch "${FILESDIR}"/${PN}-4.2.0-errwarn-message.patch
+       # Enable dhclient to get extra configuration from stdin
+       epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-stdin-conf.patch
+       epatch "${FILESDIR}"/${PN}-4.2.2-nogateway.patch #265531
+
+       # NetworkManager support patches
+       # If they fail to apply to future versions they will be dropped
+       # Add dbus support to dhclient
+       epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-dbus.patch
+
+       # Brand the version with Gentoo
+       sed -i \
+               -e "/VERSION=/s:'$: Gentoo-${PR}':" \
+               configure || die
+
+       # Change the hook script locations of the scripts
+       sed -i \
+               -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+               -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+               client/scripts/* || die
+
+       # No need for the linux script to force bash #158540
+       sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
+
+       # Quiet the freebsd logger a little
+       sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
+
+       # Remove these options from the sample config
+       sed -i \
+               -e "/\(script\|host-name\|domain-name\) / d" \
+               client/dhclient.conf || die
+
+       if use client && ! use server ; then
+               sed -i -r \
+                       -e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
+                       Makefile.in || die
+       elif ! use client && use server ; then
+               sed -i -r \
+                       -e '/^SUBDIRS/s:\<client\>::' \
+                       Makefile.in || die
+       fi
+
+       # Only install different man pages if we don't have en
+       if [[ " ${LINGUAS} " != *" en "* ]]; then
+               # Install Japanese man pages
+               if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+                       einfo "Installing Japanese documention"
+                       cp doc/ja_JP.eucJP/dhclient* client
+                       cp doc/ja_JP.eucJP/dhcp* common
+               fi
+       fi
+       # Now remove the non-english docs so there are no errors later
+       rm -rf doc/ja_JP.eucJP
+
+       # make the bind build work
+       binddir=${S}/bind
+       cd "${binddir}" || die
+       cat <<-EOF > bindvar.tmp
+       binddir=${binddir}
+       GMAKE=${MAKE:-gmake}
+       EOF
+       epatch "${FILESDIR}"/${PN}-4.2.2-bind-disable.patch
+       cd bind-*/
+       epatch "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
+       epatch "${FILESDIR}"/${PN}-4.2.2-bind-build-flags.patch
+}
+
+src_configure() {
+       # bind defaults to stupid `/usr/bin/ar`
+       tc-export AR BUILD_CC
+       export ac_cv_path_AR=${AR}
+
+       # this is tested for by the bind build system, and can cause trouble
+       # when cross-building; since dhcp itself doesn't make use of libcap,
+       # simply disable it.
+       export ac_cv_lib_cap_cap_set_proc=no
+
+       # Use FHS sane paths ... some of these have configure options,
+       # but not all, so just do it all here.
+       local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
+       cat <<-EOF >> includes/site.h
+       #define _PATH_DHCPD_CONF     "${e}/dhcpd.conf"
+       #define _PATH_DHCLIENT_CONF  "${e}/dhclient.conf"
+       #define _PATH_DHCPD_DB       "${l}/dhcpd.leases"
+       #define _PATH_DHCPD6_DB      "${l}/dhcpd6.leases"
+       #define _PATH_DHCLIENT_DB    "${l}/dhclient.leases"
+       #define _PATH_DHCLIENT6_DB   "${l}/dhclient6.leases"
+       #define _PATH_DHCPD_PID      "${r}/dhcpd.pid"
+       #define _PATH_DHCPD6_PID     "${r}/dhcpd6.pid"
+       #define _PATH_DHCLIENT_PID   "${r}/dhcpclient.pid"
+       #define _PATH_DHCLIENT6_PID  "${r}/dhcpclient6.pid"
+       #define _PATH_DHCRELAY_PID   "${r}/dhcprelay.pid"
+       #define _PATH_DHCRELAY6_PID  "${r}/dhcprelay6.pid"
+       EOF
+
+       econf \
+               --enable-paranoia \
+               --sysconfdir=${e} \
+               $(use_enable ipv6 dhcpv6) \
+               $(use_with ldap) \
+               $(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
+
+       # configure local bind cruft
+       cd bind/bind-*/ || die
+       eval econf \
+               $(sed -n '/ [.].configure /{s:^[^-]*::;s:>.*::;p}' ../Makefile) \
+               --without-make-clean
+}
+
+src_compile() {
+       # build local bind cruft first
+       emake -C bind/bind-*/lib/export install || die
+       # then build standard dhcp code
+       emake || die
+}
+
+src_install() {
+       emake install DESTDIR="${D}" || die
+
+       dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
+       dohtml doc/References.html
+
+       if [[ -e client/dhclient ]] ; then
+               # move the client to /
+               dodir /sbin
+               mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
+
+               exeinto /sbin
+               if use kernel_linux ; then
+                       newexe "${S}"/client/scripts/linux dhclient-script || die
+               else
+                       newexe "${S}"/client/scripts/freebsd dhclient-script || die
+               fi
+       fi
+
+       if [[ -e server/dhcpd ]] ; then
+               if use ldap ; then
+                       insinto /etc/openldap/schema
+                       doins contrib/ldap/dhcp.* || die
+                       dosbin contrib/ldap/dhcpd-conf-to-ldap || die
+               fi
+
+               newinitd "${FILESDIR}"/dhcpd.init3 dhcpd || die
+               newconfd "${FILESDIR}"/dhcpd.conf dhcpd || die
+               newinitd "${FILESDIR}"/dhcrelay.init2 dhcrelay || die
+               newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay || die
+       fi
+}
+
+pkg_preinst() {
+       enewgroup dhcp
+       enewuser dhcp -1 -1 /var/lib/dhcp dhcp
+
+       # Keep the user files over the sample ones
+       local f
+       for f in dhclient dhcpd ; do
+               f="/etc/dhcp/${f}.conf"
+               if [ -e "${ROOT}"${f} ] ; then
+                       cp -p "${ROOT}"${f} "${D}"${f}
+               fi
+       done
+}
+
+pkg_postinst() {
+       if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
+               ewarn
+               ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+               ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+               ewarn "and dhcp should be removed from the default runlevel"
+               ewarn
+       fi
+}
diff --git a/net-misc/dhcp/files/dhcpd.conf2 b/net-misc/dhcp/files/dhcpd.conf2
new file mode 100644 (file)
index 0000000..c3aa146
--- /dev/null
@@ -0,0 +1,29 @@
+# /etc/conf.d/dhcpd: config file for /etc/init.d/dhcpd
+
+# If you require more than one instance of dhcpd you can create symbolic
+# links to dhcpd service like so
+#   cd /etc/init.d
+#   ln -s dhcpd dhcpd.foo
+#   cd ../conf.d
+#   cp dhcpd dhcpd.foo
+# Now you can edit dhcpd.foo and specify a different configuration file.
+# You'll also need to specify a pidfile in that dhcpd.conf file.
+# See the pid-file-name option in the dhcpd.conf man page for details.
+
+# If you wish to run dhcpd in a chroot, uncomment the following line
+# DHCPD_CHROOT="/var/lib/dhcp/chroot"
+
+# Then run emerge dhcp --config
+# All file paths below are relative to the chroot.
+# You can specify a different chroot directory but MAKE SURE it's empty.
+
+# Specify a configuration file - the default is /etc/dhcp/dhcpd.conf
+# DHCPD_CONF="/etc/dhcp/dhcpd.conf"
+
+# Configure which interface or interfaces to for dhcpd to listen on.
+# List all interfaces space separated. If this is not specified then
+# we listen on all interfaces.
+# DHCPD_IFACE=""
+
+# Insert any other dhcpd options - see the man page for a full list.
+# DHCPD_OPTS=""
diff --git a/net-misc/dhcp/files/dhcpd.init4 b/net-misc/dhcp/files/dhcpd.init4
new file mode 100755 (executable)
index 0000000..ac1697c
--- /dev/null
@@ -0,0 +1,113 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init4,v 1.1 2011/09/17 05:28:58 vapier Exp $
+
+opts="configtest"
+
+: ${DHCPD_CONF:=/etc/dhcp/${SVCNAME}.conf}
+
+depend() {
+       need net
+       use logger dns
+}
+
+get_var() {
+       # we read the conf outside of the chroot as we do
+       # not configure with --enable-early-chroot
+       local var="$(sed -n 's/^[[:blank:]]\?'"$1"' "*\([^#";]\+\).*/\1/p' "${DHCPD_CONF}")"
+       echo ${var:-$2}
+}
+
+checkconfig() {
+       set -- ${DHCPD_OPTS} ${chroot:+-chroot} ${chroot} -t
+
+       dhcpd "$@" 1>/dev/null 2>&1
+       local ret=$?
+       if [ ${ret} -ne 0 ] ; then
+               eerror "${SVCNAME} has detected a syntax error in your configuration files:"
+               dhcpd "$@"
+       fi
+
+       return ${ret}
+}
+
+configtest() {
+       local chroot=${DHCPD_CHROOT}
+
+       ebegin "Checking ${SVCNAME} configuration"
+       checkconfig
+       eend $?
+}
+
+start() {
+       local chroot=${DHCPD_CHROOT}
+
+       # Work out our cffile if it's in our DHCPD_OPTS
+       case " ${DHCPD_OPTS} " in
+               *" -cf "*)
+                       DHCPD_CONF=" ${DHCPD_OPTS} "
+                       DHCPD_CONF="${DHCPD_CONF##* -cf }"
+                       DHCPD_CONF="${DHCPD_CONF%% *}"
+                       ;;
+               *)      DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}"
+                       ;;
+       esac
+
+       # see comment in get_var() above
+       if [ ! -f "${DHCPD_CONF}" ] ; then
+               eerror "${DHCPD_CONF} does not exist"
+               return 1
+       fi
+
+       if [ -n "${chroot}" ] ; then
+               # the config test want's these to exist
+               mkdir -p "${chroot}"/var/run/dhcp "${chroot}"/var/lib/dhcp
+       fi
+
+       checkconfig || return 1
+
+       checkpath -d -o dhcp:dhcp "${chroot}"/var/run/dhcp "${chroot}"/var/lib/dhcp
+
+       local leasefile="$(get_var lease-file-name /var/lib/dhcp/${SVCNAME}.leases)"
+       checkpath -f -o dhcp:dhcp "${chroot}${leasefile}"
+
+       # Setup LD_PRELOAD so name resolution works in our chroot.
+       if [ -n "${chroot}" ] ; then
+               checkpath -d -o root:root -m 755 "${chroot}"/dev "${chroot}"/etc "${chroot}"/proc
+               cp -pP /etc/localtime /etc/resolv.conf "${chroot}"/etc/
+               export LD_PRELOAD="${LD_PRELOAD} libresolv.so libnss_dns.so"
+               if ! mountinfo -q "${chroot}/proc" ; then
+                       mount --bind /proc "${chroot}/proc"
+               fi
+       fi
+
+       local pidfile="$(get_var pid-file-name /var/run/dhcp/${SVCNAME}.pid)"
+
+       ebegin "Starting ${chroot:+chrooted }${SVCNAME}"
+       start-stop-daemon --start --exec /usr/sbin/dhcpd \
+               --pidfile "${chroot}/${pidfile}" \
+               -- ${DHCPD_OPTS} -q -pf "${pidfile}" -lf "${leasefile}" \
+               -user dhcp -group dhcp \
+               ${chroot:+-chroot} ${chroot} ${DHCPD_IFACE}
+       eend $? \
+               && save_options chroot "${chroot}" \
+               && save_options pidfile "${pidfile}"
+}
+
+stop() {
+       local chroot="$(get_options chroot)"
+
+       ebegin "Stopping ${chroot:+chrooted }${SVCNAME}"
+       start-stop-daemon --stop --exec /usr/sbin/dhcpd \
+               --pidfile "${chroot}/$(get_options pidfile)"
+       res=$?
+
+       if [ ${res} -eq 0 ] && [ -n "${chroot}" ] ; then
+               if mountinfo -q "${chroot}/proc" ; then
+                       umount "${chroot}/proc"
+               fi
+       fi
+
+       eend $res
+}