Job for dnsmasq.service failed because the control process exited with error code

Bug #1464990 reported by dino99
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
dnsmasq (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Got an error while upgrading:

********
Setting up dnsmasq-base (2.72-3.1build1) ...
Setting up dnsmasq (2.72-3.1build1) ...
Job for dnsmasq.service failed because the control process exited with error code. See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
invoke-rc.d: initscript dnsmasq, action "restart" failed.
*******

systemctl status dnsmasq.service
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
  Drop-In: /run/systemd/generator/dnsmasq.service.d
           └─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
   Active: failed (Result: exit-code) since dim. 2015-06-14 12:40:41 CEST; 1min 11s ago
  Process: 29275 ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf (code=exited, status=0/SUCCESS)
  Process: 29335 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
  Process: 29331 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
 Main PID: 915 (code=exited, status=0/SUCCESS)

 systemd[1]: Starting dnsmasq - A lightweight DHCP and .....
 dnsmasq[29331]: dnsmasq: syntax check OK.
 dnsmasq[29335]: dnsmasq: failed to create listening so...se
 systemd[1]: dnsmasq.service: Control process exited, c...=2
 systemd[1]: Failed to start dnsmasq - A lightweight DH...r.
 systemd[1]: dnsmasq.service: Unit entered failed state.
 systemd[1]: dnsmasq.service: Failed with result 'exit-...'.
Hint: Some lines were ellipsized, use -l to show in full.

 journalctl -xe
 dnsmasq[29335]: failed to create listening socket for 192.168.1.2: Address already in
 dnsmasq[29335]: FAILED to start up
 systemd[1]: dnsmasq.service: Control process exited, code=exited status=2
 systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
-- Subject: L'unité (unit) dnsmasq.service a échoué
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unité (unit) dnsmasq.service a échoué, avec le résultat failed.
 systemd[1]: Dependency failed for Host and Network Name Lookups.
-- Subject: L'unité (unit) nss-lookup.target a échoué
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unité (unit) nss-lookup.target a échoué, avec le résultat dependency.
 systemd[1]: nss-lookup.target: Job nss-lookup.target/start failed with result 'depend
 systemd[1]: dnsmasq.service: Unit entered failed state.
 systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
 polkitd(authority=local)[910]: Unregistered Authentication Agent for unix-process:292

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: dnsmasq 2.72-3.1build1
ProcVersionSignature: Ubuntu 4.0.0-1.2-generic 4.0.5
Uname: Linux 4.0.0-1-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.17.3-0ubuntu4
Architecture: i386
CurrentDesktop: GNOME
Date: Sun Jun 14 12:45:55 2015
PackageArchitecture: all
SourcePackage: dnsmasq
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
dino99 (9d9) wrote :
description: updated
Revision history for this message
dino99 (9d9) wrote :

Newly 2.73-1 also produce the same error while upgrading

Revision history for this message
dino99 (9d9) wrote :

i simply purged dsnmasq as it seems to be a network-manager conflict/race

Changed in dnsmasq (Ubuntu):
status: New → Invalid
Revision history for this message
Cyrus Harmon (ch-launchpad) wrote :

FWIW, I see the same error on 15.10.

Changed in dnsmasq (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

Does it cause a noticeable malfunction?

When answered please set this bug status back to "confirmed". Thank you.

Changed in dnsmasq (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
emk2203 (emk2203) wrote :

>Does it cause a noticeable malfunction?

Yes. I run Ubuntu 16.04 on an ARM system, and the bug makes it impossible to install pi hole https://pi-hole.net/ on it, an ad blocker for other devices in the network. The effect of the bug is that other devices can't connect to the internet via this system, because dnsmasq is not running.

Changed in dnsmasq (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
emk2203 (emk2203) wrote :

This maybe a duplicate of #1531184 https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1531184 .

The proposed fix of adding the following to the [Unit] section of dnsmasq.service fixes the problem:

 After=network-online.target
 Wants=network-online.target

Revision history for this message
Max Chen (maxchen) wrote :

thanks emk2203
In Ubuntu 16.04.1, [Unit] section of dnsmasq.service fixes the problem:
 After=network-online.target
 Wants=network-online.target

I dont know why so long to release the fixed version

Revision history for this message
clickwir (clickwir) wrote :

Running 16.04.1 and this fix doesn't seem to make a difference.

Feb 5 10:55:56 ubuntu systemd[1]: dnsmasq.service: Start-post operation timed out. Stopping.
Feb 5 10:55:56 ubuntu dnsmasq[31933]: exiting on receipt of SIGTERM
Feb 5 10:55:56 ubuntu systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Feb 5 10:55:56 ubuntu systemd[1]: Dependency failed for Host and Network Name Lookups.
Feb 5 10:55:56 ubuntu systemd[1]: nss-lookup.target: Job nss-lookup.target/start failed with result 'dependency'.
Feb 5 10:55:56 ubuntu systemd[1]: dnsmasq.service: Unit entered failed state.
Feb 5 10:55:56 ubuntu systemd[1]: dnsmasq.service: Failed with result 'timeout'.

/lib/systemd/system/dnsmasq.service is where I added the 2 lines so it looks like this:

[Unit]
Description=dnsmasq - A lightweight DHCP and caching DNS server
Requires=network.target
After=network-online.target
Wants=network-online.target

Yet the error still happens: ubuntu systemd[1]: nss-lookup.target: Job nss-lookup.target/start failed with result 'dependency'.

I ran a apt --purge and removed dnsmasq completely, then reinstalled it. Got the same nss-lookup.target error. Based on some other bugs, maybe dnsmasq didn't have it's interface defined properly. So I added the interface=enp6s0 line to the dnsmasq.conf file. Restarting the service still yields the same nss-lookup.target error.

To get back to a working system, either a reboot or run "service dnsmasq start" instead of restart.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.