[Bug 985417] Re: dhcpd cannot write /var/run/dhcpd.pid

PaulSchulz paul at mawsonlakes.org
Thu Apr 26 04:11:29 UTC 2012


My fix below for IPv4 (new /etc/init/isc-dhcp-server.conf)

My take on the problem is:
- Not a apparmor issue.
- The permissions on /var/run is 755, so writable by root only.
- dhcpd tries to write it's pid file after it has dropped root permissions.
- Existing method to get around this
  (from looking at the current /etc/init/isc-dhcp-server.conf upstart file)
  is to create an dhcp-server directory and enable the ownership/permissions on that.
- The upstart conf script is broken and doesn't do this properly.
   - It only creates this directory and sets these permissions on 'restart'(?)
   - It doesn't tell 'dhcpd where is should write it's pid, which defaults to /var/run/dhcpd.pid.

Also: /var/run is being migrated to /run, so I have included that
change.

See the attache file for my rework of the upstart script which appears to work for me.
I can start, stop, restart with appropriate messages if I try to start a running service, or stop a stopped service.


** Attachment added: "/etc/init/isc-dhcp-server.conf"
   https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/985417/+attachment/3104383/+files/isc-dhcp-server.conf

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to isc-dhcp in Ubuntu.
https://bugs.launchpad.net/bugs/985417

Title:
  dhcpd cannot write  /var/run/dhcpd.pid

Status in “isc-dhcp” package in Ubuntu:
  Confirmed

Bug description:
  Description:	Ubuntu precise (development branch)
  Release:	12.04
  ---

  isc-dhcp-server:
    Telepítve: 4.1.ESV-R4-0ubuntu5
    Jelölt:    4.1.ESV-R4-0ubuntu5
    Verziótáblázat:
   *** 4.1.ESV-R4-0ubuntu5 0
          500 http://de.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
          100 /var/lib/dpkg/status
  ---
  when starting dhcpd the following can be observed in syslog:

  Apr 19 08:09:09 u3 dhcpd: Internet Systems Consortium DHCP Server 4.1-ESV-R4
  Apr 19 08:09:09 u3 dhcpd: Copyright 2004-2011 Internet Systems Consortium.
  Apr 19 08:09:09 u3 dhcpd: All rights reserved.
  Apr 19 08:09:09 u3 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
  Apr 19 08:09:09 u3 dhcpd: Internet Systems Consortium DHCP Server 4.1-ESV-R4
  Apr 19 08:09:09 u3 dhcpd: Copyright 2004-2011 Internet Systems Consortium.
  Apr 19 08:09:09 u3 dhcpd: All rights reserved.
  Apr 19 08:09:09 u3 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
  Apr 19 08:09:09 u3 dhcpd: Wrote 0 leases to leases file.
  Apr 19 08:09:09 u3 dhcpd: Can't create PID file /var/run/dhcpd.pid: Permission denied.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: isc-dhcp-server 4.1.ESV-R4-0ubuntu5
  ProcVersionSignature: Ubuntu 3.2.0-23.36-generic 3.2.14
  Uname: Linux 3.2.0-23-generic x86_64
  ApportVersion: 2.0.1-0ubuntu4
  Architecture: amd64
  Date: Thu Apr 19 08:09:16 2012
  DhServerLeases:
   
  InstallationMedia: Ubuntu-Server 12.04 LTS "Precise Pangolin" - Beta amd64 (20120417)
  SourcePackage: isc-dhcp
  UpgradeStatus: No upgrade log present (probably fresh install)
  mtime.conffile..etc.dhcp.dhcpd.conf: 2012-04-19T08:09:04.598083

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/985417/+subscriptions




More information about the foundations-bugs mailing list