Re: Dnsmasq on Debian jessie

Kevin Philp <[email protected]>
Newsgroups gmane.user-groups.linux.ilug.general
Message-ID <[email protected]>

On Thursday, 24 March 2016 14:47:07 UTC, Kevin Philp wrote:
>
> I am having some issues with dnsmasq on Jessie. I won't start under 
> systemd, so 
>
> systemctl start dnsmasq
>
> Starts the service and it works..briefly but the command takes about two 
> minutes to return and returns:
>
> Job for dnsmasq.service failed. See 'systemctl status dnsmasq.service' and 
> 'journalctl -xn' for details.
>
> systemctl status dnsmasq now says
>
> root@ccserver:/home/kevinphilp# systemctl status dnsmasq
> ● 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: timeout) since Thu 2016-03-24 14:40:40 GMT; 
> 2min 24s ago
>   Process: 21873 ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf 
> (code=killed, signal=TERM)
>   Process: 21657 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, 
> status=0/SUCCESS)
>   Process: 21655 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, 
> status=0/SUCCESS)
>  Main PID: 21665 (code=exited, status=0/SUCCESS)
>
> Mar 24 14:37:40 ccserver dnsmasq[21665]: compile time options: IPv6 
> GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ips...-detect
> Mar 24 14:37:40 ccserver dnsmasq-dhcp[21665]: DHCP, IP range 
> 192.168.100.100 -- 192.168.100.150, lease time 12h
> Mar 24 14:37:40 ccserver dnsmasq[21665]: using nameserver 159.134.0.2#53
> Mar 24 14:37:40 ccserver dnsmasq[21665]: using nameserver 159.134.0.1#53
> Mar 24 14:37:40 ccserver dnsmasq[21665]: read /etc/hosts - 12 addresses
> Mar 24 14:39:10 ccserver systemd[1]: dnsmasq.service start-post operation 
> timed out. Stopping.
> Mar 24 14:40:40 ccserver systemd[1]: dnsmasq.service stopping timed out. 
> Terminating.
> Mar 24 14:40:40 ccserver dnsmasq[21665]: exiting on receipt of SIGTERM
> Mar 24 14:40:40 ccserver systemd[1]: Failed to start dnsmasq - A 
> lightweight DHCP and caching DNS server.
> Mar 24 14:40:40 ccserver systemd[1]: Unit dnsmasq.service entered failed 
> state.
> Hint: Some lines were ellipsized, use -l to show in full.
>
> I can start dnsmasq maually without systemd and it works with no problems.
>
> I have looked through the bug reports but no clear fix.
>
> Any thoughts welcome.
>
> Thanks
>
> Kevin.
>


After a bit of digging into the files it looks like an issue with 
resolvconf. The systemd init script says:

[Unit]
Description=dnsmasq - A lightweight DHCP and caching DNS server

# KP
Requires=network.target

[Service]
Type=forking
PIDFile=/var/run/dnsmasq/dnsmasq.pid

# Test the config file and refuse starting if it is not valid.
ExecStartPre=/usr/sbin/dnsmasq --test

# We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a
# wrapper picking up extra configuration files and then execs dnsmasq
# itself, when called with the "systemd-exec" function.
ExecStart=/etc/init.d/dnsmasq systemd-exec

# The systemd-*-resolvconf functions configure (and deconfigure)
# resolvconf to work with the dnsmasq DNS server. They're called liek
# this to get correct error handling (ie don't start-resolvconf if the 
# dnsmasq daemon fails to start.
ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf


ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

If I comment out the lines

ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf

Everything works. Maybe the problem was related to us switching off 
resolvconf polling in the config file?


 

-- 
Irish Linux Users Group
--- 
You received this message because you are subscribed to the Google Groups "ILUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send an email to [email protected].
Visit this group at https://groups.google.com/a/linux.ie/group/ilug/.
To view this discussion on the web, visit https://groups.google.com/a/linux.ie/d/msgid/ilug/b362a359-1af3-45cc-bb19-343f08682700%40linux.ie.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.