Max_G
Posts: 32
Joined: Sat May 28, 2016 8:27 am

dnsmasq problem after upgrading wheezy to jessie

Wed Jun 07, 2017 11:19 am

I have upgraded my rPi2 from wheezy to jessie... it boots and seems OK, except dnsmasq fails after boot with:

Code: Select all

sudo service dnsmasq status
● 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 Wed 2017-06-07 19:55:39 AEST; 24min ago
  Process: 1526 ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf (code=killed, signal=TERM)
  Process: 626 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 558 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
 Main PID: 634 (code=exited, status=0/SUCCESS)

Jun 07 19:52:22 rpiserver dnsmasq[558]: dnsmasq: syntax check OK.
Jun 07 19:52:22 rpiserver dnsmasq[634]: started, version 2.72 cachesize 150
Jun 07 19:52:22 rpiserver dnsmasq[634]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP con...detect
Jun 07 19:52:22 rpiserver dnsmasq[634]: using nameserver 180.181.127.4#53
Jun 07 19:52:22 rpiserver dnsmasq[634]: using nameserver 180.181.127.3#53
Jun 07 19:52:22 rpiserver dnsmasq[634]: using local addresses only for domain localnet.grenkowitz.net
Jun 07 19:52:22 rpiserver dnsmasq[634]: no servers found in /var/run/dnsmasq/resolv.conf, will retry
Jun 07 19:52:22 rpiserver dnsmasq[634]: read /etc/hosts - 7 addresses
Jun 07 19:54:09 rpiserver systemd[1]: dnsmasq.service start-post operation timed out. Stopping.
Jun 07 19:55:39 rpiserver systemd[1]: dnsmasq.service stopping timed out. Terminating.
Jun 07 19:55:39 rpiserver systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Jun 07 19:55:39 rpiserver systemd[1]: Unit dnsmasq.service entered failed state.
I can start dnsmasq with sudo dnsmasq and it works.

Any ideas on where to look?

epoch1970
Posts: 3339
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: dnsmasq problem after upgrading wheezy to jessie

Thu Jun 08, 2017 9:42 am

I've seen that "bind interfaces" (a pretty specific option that seems quite popular) is not too compatible with systemd's way of shuffling interfaces on- and off-line on demand.
If you specify it, I would try commenting it.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Max_G
Posts: 32
Joined: Sat May 28, 2016 8:27 am

Re: dnsmasq problem after upgrading wheezy to jessie

Thu Jun 08, 2017 10:11 am

Thanks...

I should have posted the config...

Code: Select all

grep -E -v '(^$)|(^#)' /etc/dnsmasq.conf
domain-needed
bogus-priv
local=/localnet.beta.net/
server=180.181.12.3
server=180.181.12.4
interface=eth0
listen-address=127.0.0.1
no-dhcp-interface=
expand-hosts
domain=alpha.org

epoch1970
Posts: 3339
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: dnsmasq problem after upgrading wheezy to jessie

Thu Jun 08, 2017 7:47 pm

Looks ok to me, except perhaps this: "no-dhcp-interface="
In /etc/default/dnsmasq, "ENABLED=1" is defined, isn't?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Max_G
Posts: 32
Joined: Sat May 28, 2016 8:27 am

Re: dnsmasq problem after upgrading wheezy to jessie

Thu Jun 08, 2017 9:40 pm

I am using the isc-DHCP service; and later required a DNS proxy, when I installed dnsmasq. IT was working fine, until I made the upgrade from Wheezy to Jessie. :?
Have googled this problem, but can't find a solution.

epoch1970
Posts: 3339
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: dnsmasq problem after upgrading wheezy to jessie

Fri Jun 09, 2017 7:34 am

A quick googling told me the way to restrict dnsmasq to DNS service only would be to remove any dhcp-related option from the config file.
So I would remove this incomplete no-dhcp-interface line.

Then on second thought, you're using both "interface" and "listen-address". I don't know how they mix, but your specs are not identical I think; AFAIK by default dnsmasq listens to lo, so "interfaces=eth0" is equivalent to specifying, e.g. "listen-address=127.0.0.1,192.168.1.1"
With systemd reorganizing interfaces incessantly (esp. at boot time) I guess specifying interfaces names is safer.
I would suggest you turn to "man dnsmasq" once more, the man page is quite thorough.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Max_G
Posts: 32
Joined: Sat May 28, 2016 8:27 am

Re: dnsmasq problem after upgrading wheezy to jessie

Sat Jun 10, 2017 7:07 am

Thanks :)

as for interface address and listen address: Listen on the given IP address(es). Both --interface and --listen-address options may be given, in which case the set of both interfaces and addresses is used. Note that if no --interface option is given, but --listen-address is, dnsmasq will not automatically listen on the loopback interface. To achieve this, its IP address, 127.0.0.1, must be explicitly given as a --listen-address option.

However, given that config worked and has not changed by the upgrade, you could be onto something. WRT interface shuffling at start-up or systemd... I thikn the latter is the culprit... all I need is figuring out how to fix it :(

Return to “Troubleshooting”