Chris Green
2018-07-18 09:42:42 UTC
I have dnsmasq running on a Raspberry Pi providing DHCP and DNS on my
home network.
It looks as if we had a power failure overnight and, as a result (I
think) dnsmasq won't restart on the Raspberry Pi when I reboot it. If
I run dnsmasq manually from the command line it works OK, thus I do
have DHCP/DNS back now but I'd like it to start at boot time.
I did recently update to a newer Raspbian so the power failure *might*
be a red herring.
The diagnostics from systemd when you try and restart dnsmasq are as
follows:-
***@raspberrypi:~# /etc/init.d/dnsmasq restart
[....] Restarting dnsmasq (via systemctl): dnsmasq.serviceJob for dnsmasq.service failed. See 'systemctl status dnsmasq.service' and 'journalctl -xn' for details.
failed!
***@raspberrypi:~# systemctl status dnsmasq.service
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled)
Drop-In: /run/systemd/generator/dnsmasq.service.d
└─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
Active: failed (Result: exit-code) since Wed 2018-07-18 10:34:18 BST; 14s ago
Process: 963 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=1/FAILURE)
Process: 960 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
Jul 18 10:34:17 raspberrypi dnsmasq[960]: dnsmasq: syntax check OK.
Jul 18 10:34:18 raspberrypi dnsmasq[963]: dnsmasq: junk found in command line
Jul 18 10:34:18 raspberrypi systemd[1]: dnsmasq.service: control process exited, code=exited status=1
Jul 18 10:34:18 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Jul 18 10:34:18 raspberrypi systemd[1]: Unit dnsmasq.service entered failed state.
***@raspberrypi:~# ps -ef | grep dns
nobody 911 1 0 10:31 ? 00:00:00 dnsmasq
root 991 942 0 10:34 pts/0 00:00:00 grep dns
***@raspberrypi:~# journalctl -xn
-- Logs begin at Wed 2018-07-18 10:17:03 BST, end at Wed 2018-07-18 10:34:43 BST. --
Jul 18 10:34:18 raspberrypi dnsmasq[963]: dnsmasq: junk found in command line
Jul 18 10:34:18 raspberrypi dnsmasq[963]: junk found in command line
Jul 18 10:34:18 raspberrypi dnsmasq[963]: FAILED to start up
Jul 18 10:34:18 raspberrypi systemd[1]: dnsmasq.service: control process exited, code=exited status=1
Jul 18 10:34:18 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
-- Subject: Unit dnsmasq.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit dnsmasq.service has failed.
--
-- The result is failed.
Jul 18 10:34:18 raspberrypi systemd[1]: Dependency failed for Host and Network Name Lookups.
-- Subject: Unit nss-lookup.target has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nss-lookup.target has failed.
--
-- The result is dependency.
Jul 18 10:34:18 raspberrypi systemd[1]: Unit dnsmasq.service entered failed state.
Jul 18 10:34:43 raspberrypi systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has begun starting up.
Jul 18 10:34:43 raspberrypi systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has finished starting up.
--
-- The start-up result is done.
So what's wrong and how do I fix it?
home network.
It looks as if we had a power failure overnight and, as a result (I
think) dnsmasq won't restart on the Raspberry Pi when I reboot it. If
I run dnsmasq manually from the command line it works OK, thus I do
have DHCP/DNS back now but I'd like it to start at boot time.
I did recently update to a newer Raspbian so the power failure *might*
be a red herring.
The diagnostics from systemd when you try and restart dnsmasq are as
follows:-
***@raspberrypi:~# /etc/init.d/dnsmasq restart
[....] Restarting dnsmasq (via systemctl): dnsmasq.serviceJob for dnsmasq.service failed. See 'systemctl status dnsmasq.service' and 'journalctl -xn' for details.
failed!
***@raspberrypi:~# systemctl status dnsmasq.service
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled)
Drop-In: /run/systemd/generator/dnsmasq.service.d
└─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
Active: failed (Result: exit-code) since Wed 2018-07-18 10:34:18 BST; 14s ago
Process: 963 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=1/FAILURE)
Process: 960 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
Jul 18 10:34:17 raspberrypi dnsmasq[960]: dnsmasq: syntax check OK.
Jul 18 10:34:18 raspberrypi dnsmasq[963]: dnsmasq: junk found in command line
Jul 18 10:34:18 raspberrypi systemd[1]: dnsmasq.service: control process exited, code=exited status=1
Jul 18 10:34:18 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Jul 18 10:34:18 raspberrypi systemd[1]: Unit dnsmasq.service entered failed state.
***@raspberrypi:~# ps -ef | grep dns
nobody 911 1 0 10:31 ? 00:00:00 dnsmasq
root 991 942 0 10:34 pts/0 00:00:00 grep dns
***@raspberrypi:~# journalctl -xn
-- Logs begin at Wed 2018-07-18 10:17:03 BST, end at Wed 2018-07-18 10:34:43 BST. --
Jul 18 10:34:18 raspberrypi dnsmasq[963]: dnsmasq: junk found in command line
Jul 18 10:34:18 raspberrypi dnsmasq[963]: junk found in command line
Jul 18 10:34:18 raspberrypi dnsmasq[963]: FAILED to start up
Jul 18 10:34:18 raspberrypi systemd[1]: dnsmasq.service: control process exited, code=exited status=1
Jul 18 10:34:18 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
-- Subject: Unit dnsmasq.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit dnsmasq.service has failed.
--
-- The result is failed.
Jul 18 10:34:18 raspberrypi systemd[1]: Dependency failed for Host and Network Name Lookups.
-- Subject: Unit nss-lookup.target has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nss-lookup.target has failed.
--
-- The result is dependency.
Jul 18 10:34:18 raspberrypi systemd[1]: Unit dnsmasq.service entered failed state.
Jul 18 10:34:43 raspberrypi systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has begun starting up.
Jul 18 10:34:43 raspberrypi systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has finished starting up.
--
-- The start-up result is done.
So what's wrong and how do I fix it?
--
Chris Green
Chris Green