Comment 4 for bug 1531184

Revision history for this message
Immatix (immatix) wrote : Re: dnsmasq doesn't start on boot because its interface isn't up yet

I believe I was having the same problem, I use the --bind-interfaces option as well as a few --interface options for different interfaces, and dnsmasq would regularly fail to start during boot because one of the interfaces wasn't present yet. Logs show dnsmasq was being started before network.target was reached.

Apr 30 22:23:19 sirius systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Apr 30 22:23:20 sirius dnsmasq[1152]: dnsmasq: syntax check OK.
Apr 30 22:23:20 sirius dnsmasq[1296]: dnsmasq: unknown interface trunk.3
Apr 30 22:23:20 sirius systemd[1]: dnsmasq.service: Control process exited, code=exited status=2
Apr 30 22:23:20 sirius systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Apr 30 22:23:20 sirius systemd[1]: dnsmasq.service: Unit entered failed state.
Apr 30 22:23:20 sirius systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
---
Apr 30 22:23:27 sirius systemd[1]: Reached target Network.

I've since added

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

to the [Unit] section of /lib/systemd/system/dnsmasq.service and restarted once and the problem didn't occur, but this hasn't been extensively tested.