[Bug 1543794] Re: isc-dhcp-server fails to start on second & further attempts with 'Can't open /var/lib/dhcp/dhcpd.leases for append'
Thomas Dreibholz
dreibh at iem.uni-due.de
Wed Aug 3 09:26:40 UTC 2016
The problem still exists, for 4.3.3-5ubuntu12.1 (Ubuntu 16.04).
How to reproduce (using /etc/dhcp/dhcpd.conf installed from the package
itself, without changes):
1. Starting with a fresh install:
nornetpp at bjoernson:~$ sudo rm -rf /var/lib/dhcp /run/dhcp-server
nornetpp at bjoernson:~$ sudo apt-get install --reinstall isc-dhcp-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/412 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 105366 files and directories currently installed.)
Preparing to unpack .../isc-dhcp-server_4.3.3-5ubuntu12.1_amd64.deb ...
Unpacking isc-dhcp-server (4.3.3-5ubuntu12.1) over (4.3.3-5ubuntu12.1) ...
Processing triggers for systemd (229-4ubuntu7) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up isc-dhcp-server (4.3.3-5ubuntu12.1) ...
insserv: warning: script 'screen-cleanup' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `screen-cleanup'
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `screen-cleanup'
isc-dhcp-server start/running, process 24418
nornetpp at bjoernson:~$ apt-show-versions | grep isc-dhcp-server
isc-dhcp-server:amd64/xenial-updates 4.3.3-5ubuntu12.1 uptodate
isc-dhcp-server:i386 not installed
2. Starting the service fails:
nornetpp at bjoernson:~$ sudo service isc-dhcp-server start
isc-dhcp-server start/running, process 24553
nornetpp at bjoernson:~$ sleep 3
nornetpp at bjoernson:~$ sudo service isc-dhcp-server status
isc-dhcp-server stop/waiting
nornetpp at bjoernson:~$ tail -n20 /var/log/syslog.1
Aug 3 11:23:35 bjoernson dhcpd[24599]: process and the information we find helpful for debugging..
Aug 3 11:23:35 bjoernson dhcpd[24599]:
Aug 3 11:23:35 bjoernson dhcpd[24599]: exiting.
Aug 3 11:23:35 bjoernson dhcpd[24603]: Internet Systems Consortium DHCP Server 4.3.3
Aug 3 11:23:35 bjoernson dhcpd[24603]: Copyright 2004-2015 Internet Systems Consortium.
Aug 3 11:23:35 bjoernson dhcpd[24603]: All rights reserved.
Aug 3 11:23:35 bjoernson dhcpd[24603]: For info, please visit https://www.isc.org/software/dhcp/
Aug 3 11:23:35 bjoernson dhcpd[24604]: Internet Systems Consortium DHCP Server 4.3.3
Aug 3 11:23:35 bjoernson dhcpd[24604]: Copyright 2004-2015 Internet Systems Consortium.
Aug 3 11:23:35 bjoernson dhcpd[24604]: All rights reserved.
Aug 3 11:23:35 bjoernson dhcpd[24604]: For info, please visit https://www.isc.org/software/dhcp/
Aug 3 11:23:35 bjoernson dhcpd[24604]: Can't open /var/lib/dhcp/dhcpd.leases for append.
Aug 3 11:23:35 bjoernson dhcpd[24604]:
Aug 3 11:23:35 bjoernson dhcpd[24604]: If you think you have received this message due to a bug rather
Aug 3 11:23:35 bjoernson dhcpd[24604]: than a configuration issue please read the section on submitting
Aug 3 11:23:35 bjoernson dhcpd[24604]: bugs on either our web page at www.isc.org or in the README file
Aug 3 11:23:35 bjoernson dhcpd[24604]: before submitting a bug. These pages explain the proper
Aug 3 11:23:35 bjoernson dhcpd[24604]: process and the information we find helpful for debugging..
Aug 3 11:23:35 bjoernson dhcpd[24604]:
Aug 3 11:23:35 bjoernson dhcpd[24604]: exiting.
nornetpp at bjoernson:~$ sudo service isc-dhcp-server stop
stop: Unknown instance:
3. Checking permissions, and setting them according to comment #7:
nornetpp at bjoernson:~$ ls -al /var/lib/dhcp
total 5
drwxr-xr-x 2 root root 112 Aug 3 11:22 .
drwxr-xr-x 54 root root 1440 Aug 3 11:22 ..
-rw-r--r-- 1 dhcpd dhcpd 125 Aug 3 11:22 dhcpd.leases
-rw-r--r-- 1 root root 0 Aug 3 11:22 dhcpd.leases~
nornetpp at bjoernson:~$ sudo chmod 664 /var/lib/dhcp/*.leases
nornetpp at bjoernson:~$ sudo chown root:dhcpd -R /var/lib/dhcp
nornetpp at bjoernson:~$ sudo chmod 775 /var/lib/dhcp
nornetpp at bjoernson:~$ ls -al /var/lib/dhcp
total 5
drwxrwxr-x 2 root dhcpd 112 Aug 3 11:22 .
drwxr-xr-x 54 root root 1440 Aug 3 11:22 ..
-rw-rw-r-- 1 root dhcpd 125 Aug 3 11:22 dhcpd.leases
-rw-r--r-- 1 root dhcpd 0 Aug 3 11:22 dhcpd.leases~
nornetpp at bjoernson:~$
nornetpp at bjoernson:~$ ls -al /run/dhcp-server
total 0
drwxr-xr-x 2 dhcpd dhcpd 40 Aug 3 11:22 .
drwxr-xr-x 31 root root 1260 Aug 3 11:22 ..
nornetpp at bjoernson:~$ sudo chmod 775 /run/dhcp-server
nornetpp at bjoernson:~$ sudo chown root:dhcpd -R /run/dhcp-server
nornetpp at bjoernson:~$ ls -al /run/dhcp-server
total 0
drwxrwxr-x 2 root dhcpd 40 Aug 3 11:22 .
drwxr-xr-x 31 root root 1260 Aug 3 11:22 ..
4. Trying again (without success):
nornetpp at bjoernson:~$ sudo service isc-dhcp-server start
isc-dhcp-server start/running, process 24649
nornetpp at bjoernson:~$ sleep 3
nornetpp at bjoernson:~$ sudo service isc-dhcp-server status
isc-dhcp-server stop/waiting
nornetpp at bjoernson:~$ tail -n20 /var/log/syslog.1
Aug 3 11:24:38 bjoernson dhcpd[24695]: process and the information we find helpful for debugging..
Aug 3 11:24:38 bjoernson dhcpd[24695]:
Aug 3 11:24:38 bjoernson dhcpd[24695]: exiting.
Aug 3 11:24:38 bjoernson dhcpd[24699]: Internet Systems Consortium DHCP Server 4.3.3
Aug 3 11:24:38 bjoernson dhcpd[24699]: Copyright 2004-2015 Internet Systems Consortium.
Aug 3 11:24:38 bjoernson dhcpd[24699]: All rights reserved.
Aug 3 11:24:38 bjoernson dhcpd[24699]: For info, please visit https://www.isc.org/software/dhcp/
Aug 3 11:24:38 bjoernson dhcpd[24700]: Internet Systems Consortium DHCP Server 4.3.3
Aug 3 11:24:38 bjoernson dhcpd[24700]: Copyright 2004-2015 Internet Systems Consortium.
Aug 3 11:24:38 bjoernson dhcpd[24700]: All rights reserved.
Aug 3 11:24:38 bjoernson dhcpd[24700]: For info, please visit https://www.isc.org/software/dhcp/
Aug 3 11:24:38 bjoernson dhcpd[24700]: Can't open /var/lib/dhcp/dhcpd.leases for append.
Aug 3 11:24:38 bjoernson dhcpd[24700]:
Aug 3 11:24:38 bjoernson dhcpd[24700]: If you think you have received this message due to a bug rather
Aug 3 11:24:38 bjoernson dhcpd[24700]: than a configuration issue please read the section on submitting
Aug 3 11:24:38 bjoernson dhcpd[24700]: bugs on either our web page at www.isc.org or in the README file
Aug 3 11:24:38 bjoernson dhcpd[24700]: before submitting a bug. These pages explain the proper
Aug 3 11:24:38 bjoernson dhcpd[24700]: process and the information we find helpful for debugging..
Aug 3 11:24:38 bjoernson dhcpd[24700]:
Aug 3 11:24:38 bjoernson dhcpd[24700]: exiting.
--
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/1543794
Title:
isc-dhcp-server fails to start on second & further attempts with
'Can't open /var/lib/dhcp/dhcpd.leases for append'
Status in isc-dhcp package in Ubuntu:
Fix Released
Bug description:
During the first start of isc-dhcp-server (using the systemd service
unit), a blank dhcpd.leases file is created (presumably owned by
root:root). dhcpd starts successfully (and then exits due to no
subnet definitions, that's expected).
Attempting to start the service again fails with 'Can't open
/var/lib/dhcp/dhcpd.leases for append' (the dhcpd.leases file
ownership is now dhcpd.dhcpd), and apparmor logs a denial of the
dac_override capability.
Removing the leases file repeats this process (first start works as
expected, future ones do not).
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: isc-dhcp-server 4.3.3-5ubuntu4
ProcVersionSignature: Ubuntu 4.4.0-2.16-generic 4.4.0
Uname: Linux 4.4.0-2-generic x86_64
ApportVersion: 2.19.4-0ubuntu2
Architecture: amd64
Date: Tue Feb 9 20:58:12 2016
InstallationDate: Installed on 2016-02-09 (0 days ago)
InstallationMedia: Ubuntu-Server 16.04 LTS "Xenial Xerus" - Alpha amd64 (20160206)
ProcEnviron:
LANGUAGE=en_GB:en
TERM=linux
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: isc-dhcp
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1543794/+subscriptions
More information about the foundations-bugs
mailing list