FS#35639 - [dnsmasq] dnsmasq starts before network.service is completed

Attached to Project: Arch Linux
Opened by Dirk Janssens (bc547) - Tuesday, 04 June 2013, 14:38 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 05 June 2013, 22:08 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The current systemd service file allows dnsmasq to start before network.service is completed. As a result, dnsmasq already brings up the interface, and the subsequent netctl scripts fail to initialize the interface and the interface does not get an ip.

The solution that worked for me was to add 'Requires=network.target' to the [Unit] section in /usr/lib/systemd/system/dnsmasq.service


Additional info:
* package version(s)
dnsmasq 2.66-1

* config and/or log files. (In my case, my interface is named enp9s0).

/etc/dnsmasq.conf
interface=enp9s0

/etc/netctl/enp9s0
Description='A basic static ethernet connection'
Interface=enp9s0
Connection=ethernet
IP=static
Address=('10.0.0.112/24')


journalctl -b gives:

Jun 04 15:42:33 servy dnsmasq[238]: started, version 2.66 cachesize 150
Jun 04 15:42:33 servy dnsmasq[238]: compile time options: IPv6 GNU-getopt DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth
Jun 04 15:42:33 servy dnsmasq[238]: DBus support enabled: connected to system bus
Jun 04 15:42:33 servy dnsmasq[238]: warning: interface enp9s0 does not currently exist
Jun 04 15:42:33 servy dnsmasq-dhcp[238]: DHCP, IP range 10.0.0.100 -- 10.0.0.200, lease time 15m
Jun 04 15:42:33 servy dnsmasq[238]: using nameserver 8.8.8.8#53
Jun 04 15:42:33 servy dnsmasq[238]: read /etc/hosts - 8 addresses
...
Jun 04 15:42:39 servy network[163]: Starting network profile 'enp9s0'...
Jun 04 15:42:39 servy network[163]: The interface of network profile 'enp9s0' is already up
Jun 04 15:42:39 servy systemd[1]: Unit netctl@enp9s0.service entered failed state.


After adding the Requires directive in the service file:

Jun 04 16:17:03 servy network[163]: Starting network profile 'enp9s0'...
Jun 04 16:17:03 servy network[163]: Started network profile 'enp9s0'
Jun 04 16:17:04 servy dnsmasq[320]: dnsmasq: syntax check OK.
Jun 04 16:17:04 servy systemd[1]: Started A lightweight DHCP and caching DNS server.
Jun 04 16:17:04 servy dnsmasq[327]: started, version 2.66 cachesize 150
Jun 04 16:17:04 servy dnsmasq[327]: compile time options: IPv6 GNU-getopt DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth
Jun 04 16:17:04 servy dnsmasq[327]: DBus support enabled: connected to system bus
Jun 04 16:17:04 servy dnsmasq-dhcp[327]: DHCP, IP range 10.0.0.100 -- 10.0.0.200, lease time 15m
Jun 04 16:17:04 servy dnsmasq[327]: using nameserver 8.8.8.8#53
Jun 04 16:17:04 servy dnsmasq[327]: read /etc/hosts - 8 addresses
This task depends upon

Closed by  Dave Reisner (falconindy)
Wednesday, 05 June 2013, 22:08 GMT
Reason for closing:  Not a bug
Comment by Dave Reisner (falconindy) - Tuesday, 04 June 2013, 18:05 GMT
> The current systemd service file allows dnsmasq to start before network.service is completed
No, that's incorrect. For starters, there is no network.service (unless this is something you've created yourself). If network.target is activated before the network is actually available, then the unit with the Wants on network.target is wrongly written.

Requires=network.target is wrong, and it won't be added.

Fix your network.target activation.

Loading...