[Bug 1551855] Re: [xenial] systemctl hangs when stopping isc-dhcp-server
Jamie Strandboge
jamie at ubuntu.com
Tue Mar 1 17:34:57 UTC 2016
*** This bug is a duplicate of bug 1551351 ***
https://bugs.launchpad.net/bugs/1551351
** This bug has been marked a duplicate of bug 1551351
dhclient does not renew leases
--
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/1551855
Title:
[xenial] systemctl hangs when stopping isc-dhcp-server
Status in isc-dhcp package in Ubuntu:
Confirmed
Bug description:
This affects both 4.3.3-5ubuntu8 that exists in xenial right now and
4.3.3-5ubuntu9 which I just uploaded to fix another bug.
With the move to systemd service file, 'sudo systemctl stop isc-dhcp-
server.service' just hangs. Here is the service file (from
4.3.3-5ubuntu9):
[Unit]
Description=ISC DHCP IPv4 server
Documentation=man:dhcpd(8)
Wants=network-online.target
After=network-online.target
After=time-sync.target
ConditionPathExists=/etc/default/isc-dhcp-server
ConditionPathExists=|/etc/ltsp/dhcpd.conf
ConditionPathExists=|/etc/dhcp/dhcpd.conf
[Service]
EnvironmentFile=/etc/default/isc-dhcp-server
RuntimeDirectory=dhcp-server
# The leases files need to be root:dhcpd even when dropping privileges
ExecStart=/bin/sh -ec '\
CONFIG_FILE=/etc/dhcp/dhcpd.conf; \
if [ -f /etc/ltsp/dhcpd.conf ]; then CONFIG_FILE=/etc/ltsp/dhcpd.conf; fi; \
[ -e /var/lib/dhcp/dhcpd.leases ] || touch /var/lib/dhcp/dhcpd.leases; \
chown root:dhcpd /var/lib/dhcp /var/lib/dhcp/dhcpd.leases; \
chmod 775 /var/lib/dhcp ; chmod 664 /var/lib/dhcp/dhcpd.leases; \
exec dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf $CONFIG_FILE $INTERFACES'
[Install]
WantedBy=multi-user.target
Eg:
$ sudo systemctl stop isc-dhcp-server.service
<hangs>
wait long enough and systemd will KILL it. In the logs:
Mar 1 10:58:14 sec-xenial-amd64 systemd[1]: isc-dhcp-server.service: State 'stop-sigterm' timed out. Killing.
Mar 1 10:58:14 sec-xenial-amd64 systemd[1]: isc-dhcp-server.service: Main process exited, code=killed, status=9/KILL
Mar 1 10:58:14 sec-xenial-amd64 systemd[1]: isc-dhcp-server.service: Unit entered failed state.
Mar 1 10:58:14 sec-xenial-amd64 systemd[1]: isc-dhcp-server.service: Failed with result 'signal'.
Things I tried to resolve it, none of which worked:
* add Type=forking
* add Type=forking and remove '-f' from the dhcpd exec
* adjust /run/dhcp-server to be root:root and 755
* adjust /run/dhcp-server to be dhcpd:dhcpd and 755 (this was in 4.3.3-5ubuntu8 but fails to create a pid file and was fixed in 4.3.3-5ubuntu9)
* adjust /run/dhcp-server to be root:dhcpd and 775
* add Type=forking and remove '-f' from the dhcpd exec and use KillSignal=SIGINT (see https://wiki.archlinux.org/index.php/Dhcpd#Service_file)
This bug is not related to AppArmor. With 4.3.3-5ubuntu9 this bug persists and there are no apparmor denials. Furthermore, if I disable the apparmor profile, the bug persists.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1551855/+subscriptions
More information about the foundations-bugs
mailing list