dnsmasq starts with error on Ubuntu Xenial amd64 when squid installed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dnsmasq (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Invalid
|
High
|
Unassigned | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
squid (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Invalid
|
Undecided
|
Unassigned | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
squid3 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
High
|
Sergio Durigan Junior | ||
Bionic |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
[Impact]
When using dnsmasq along with squid on Ubuntu Xenial, the user will experience a deadlock while performing on every second execution of the "systemctl start dnsmasq.service" command. The deadlock will be caused by an attempt to invoke, by nss-lookup.target, a "systemctl reload squid.service", which will itself try to start the nss-lookup.target, which will be waiting on squid, therefore eventually leading to a timeout.
The underlying cause of this deadlock is related to how systemd used to handle dependencies between multiple jobs being started in the same transaction.
[Test Case]
One can reproduce the issue on a Xenial container:
$ lxc launch ubuntu-daily:xenial squid-bug1761096
$ lxc shell squid-bug1761096
# apt update
# apt install squid dnsmasq -y
It is quite possible that during "apt install" the bug will manifest, and dnsmasq will fail to start due to a timeout. The user might see a message like:
Job for dnsmasq.service failed because a timeout was exceeded. See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
If the bug doesn't manifest itself during installation, the following commands in sequence should trigger it:
# systemctl restart dnsmasq.service
# systemctl restart dnsmasq.service
[Regression Potential]
This change only touches the mechanism by which squid has its configuration reloaded in case of a DNS resolver change. Because "systemctl reload --no-block" returns practically immediately, if squid's configuration file is invalid the user won't see any notifications. However, this behaviour is already present currently, because "systemctl reload squid" invokes "/etc/init.d/squid reload"; the user has to check "journalctl -u squid.service" if she wants to verify whether there were any failures during the reload.
Other than that, and because systemctl will offload the service to the SysV script as usual (in the case of squid), I don't foresee any potential regressions.
[Original Description]
Setup to reproduce:
Ubuntu Xenial amd64 net install iso from http://
Install system with mostly defaults + LVM + OpenSSH server
Note that this bug applies to both DHCP and static IP+DNS network configurations
Once server rebooted and is available, log in and install dnsmasq + squid:
apt-get update && apt-get install squid dnsmasq
output of this can be found at https:/
journalctl -xe output at https:/
Furthermore at this point I can run alternating errors
root@ubuntu-min:~# date ; service dnsmasq start ; date
Wed Apr 4 09:18:07 CEST 2018
Wed Apr 4 09:18:07 CEST 2018
root@ubuntu-min:~# date ; service dnsmasq stop ; date
Wed Apr 4 09:18:39 CEST 2018
Wed Apr 4 09:18:39 CEST 2018
root@ubuntu-min:~# date ; service dnsmasq start ; date
Wed Apr 4 09:19:10 CEST 2018
Job for dnsmasq.service failed because a timeout was exceeded. See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
Wed Apr 4 09:20:40 CEST 2018
root@ubuntu-min:~# date ; service dnsmasq start ; date
Wed Apr 4 09:42:57 CEST 2018
Wed Apr 4 09:42:57 CEST 2018
root@ubuntu-min:~# date ; service dnsmasq stop ; date
Wed Apr 4 09:43:14 CEST 2018
Wed Apr 4 09:43:14 CEST 2018
root@ubuntu-min:~# date ; service dnsmasq start ; date
Wed Apr 4 09:43:26 CEST 2018
Job for dnsmasq.service failed because a timeout was exceeded. See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
Wed Apr 4 09:44:56 CEST 2018
and so on... Each and every 1 out of 2 stop/start cycle fails in 1m30s timeout
Complete journalctl -xe output attached
Related branches
- Christian Ehrhardt (community): Approve
- Canonical Server Core Reviewers: Pending requested
- Canonical Server: Pending requested
-
Diff: 35 lines (+17/-1)2 files modifieddebian/changelog (+11/-0)
debian/squid.resolvconf (+6/-1)
tags: | removed: server-next |
Note that this does not apply to bionic release nor artful for which everything seems to be working very smoothly