Bug 35751 - chroot'ed DHCPD fails to stop on command
Bug#: 35751 Product:  Gentoo Linux Version: 1.4 Platform: All
OS/Version: Linux Status: RESOLVED Severity: minor Priority: P3
Resolution: FIXED Assigned To: max@gentoo.org Reported By: peeyotch@peeyotch.org
Component: Server
URL: 
Summary: chroot'ed DHCPD fails to stop on command
Keywords:  
Status Whiteboard: 
Opened: 2003-12-13 12:39 0000
Description:   Opened: 2003-12-13 12:39 0000
When DHCPD is run chroot'ed, "/etc/init.d/dhcp stop" reports [!!] and the
process continues to run.

STEPS TO DUPLICATE
1) emerge dhcp
2) edit /etc/conf.d/dhcp to use chroot, /etc/init.d/dhcp start
3) attempt /etc/init.d/dhcp stop

WHY IT HAPPENS

The stop() section of the init file fails to account for the possibility of a
chrooted setup.  

HOW TO FIX IT

--- /etc/init.d/dhcp    2003-12-13 14:05:19.000000000 -0600
+++ /etc/init.d/dhcp.new        2003-12-13 14:05:55.000000000 -0600
@@ -38,6 +38,6 @@

 stop() {
        ebegin "Stopping dhcpd"
-       start-stop-daemon --stop --quiet --pidfile /var/run/dhcp/dhcpd.pid
+       start-stop-daemon --stop --quiet --pidfile
${CHROOT}/var/run/dhcp/dhcpd.
pid
        eend $?
 }

------- Comment #1 From Peeyotch 2003-12-13 12:48:19 0000 -------
confirmed after re-emerge

------- Comment #2 From Chris Snyder 2003-12-22 12:45:13 0000 -------
Another comment:

The ebuild does not automatically create and chown to dhcp:dhcp the /chroot/dhcp/var/run/dhcp directory needed for dhcpd to store its PID.

------- Comment #3 From Max Kalika (RETIRED) 2003-12-22 13:55:50 0000 -------
i noticed this the other day.  I'll try to get a fix in later today.

------- Comment #4 From Max Kalika (RETIRED) 2004-01-14 17:15:20 0000 -------
Both of these issues are fixed in -r3.  Thanks for the report.