Comment 12 for bug 985417

Revision history for this message
Barry Warsaw (barry) wrote :

I just encountered the same problem. I did two things to work around this:

% cd /etc
% bzr diff
=== modified file 'apparmor.d/usr.sbin.dhcpd'
--- apparmor.d/usr.sbin.dhcpd 2012-05-18 01:12:29 +0000
+++ apparmor.d/usr.sbin.dhcpd 2012-05-19 21:10:55 +0000
@@ -32,7 +32,7 @@
   /var/lib/dhcp/dhcpd{,6}.leases* lrw,
   /var/log/ r,
   /var/log/** rw,
- /{,var/}run/{,dhcp-server/}dhcpd{,6}.pid w,
+ /{,var/}run/{,dhcp-server/}dhcpd{,6}.pid rw,

   # LTSP. See:
   # http://www.ltsp.org/~sbalneav/LTSPManual.html

=== modified file 'dhcp/dhcpd.conf'
--- dhcp/dhcpd.conf 2012-05-19 21:01:43 +0000
+++ dhcp/dhcpd.conf 2012-05-19 21:09:07 +0000
@@ -31,7 +31,7 @@
 # have to hack syslog.conf to complete the redirection).
 log-facility local7;

-pid-file-name "/var/run/dhcp-server/dhcpd.pid";
+pid-file-name "/run/dhcp-server/dhcpd.pid";

 subnet xxx.xxx.xxx.0 netmask 255.255.255.0 {
     option routers xxx.xxx.xxx.xxx;

I honestly don't know whether this is the *right* thing to do, but it works for me (please let me know if I'm opening massive vulnerabilities :).

I think there are possibly two bugs here. The first would be that the default pid file for dhcpd puts it in a location that isn't writable. The second is that even after relocating the pid file, the apparmor setting doesn't allow for reading the pid file.