SOLVED: dnsmasq service failed

User avatar
hemington1
Posts: 156
Joined: Mon Nov 26, 2012 6:38 pm
Location: Perth Western Australia

SOLVED: dnsmasq service failed

Postby hemington1 » Wed Feb 23, 2022 4:56 am

Hello, I recently had a power failure and on restarting my HDA, it was unable to provide dhcp leases. I had to resort to router dhcp.
A dnsmasq status returned the following:
[******@localhost ~]$ systemctl status dnsmasq
● dnsmasq.service - DNS caching server.
Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-02-23 19:29:19 AWST; 20min ago
Process: 25637 ExecStart=/usr/sbin/dnsmasq -k (code=exited, status=2)
Main PID: 25637 (code=exited, status=2)

Feb 23 19:29:19 localhost.localdomain systemd[1]: Started DNS caching server..
Feb 23 19:29:19 localhost.localdomain dnsmasq[25637]: dnsmasq: failed to bind DHCP server socket: Addr
Feb 23 19:29:19 localhost.localdomain dnsmasq[25637]: failed to bind DHCP server socket: Address alrea
Feb 23 19:29:19 localhost.localdomain dnsmasq[25637]: FAILED to start up
Feb 23 19:29:19 localhost.localdomain systemd[1]: dnsmasq.service: Main process exited, code=exited, s
Feb 23 19:29:19 localhost.localdomain systemd[1]: dnsmasq.service: Unit entered failed state.
Feb 23 19:29:19 localhost.localdomain systemd[1]: dnsmasq.service: Failed with result 'exit-code'.

Not sure how to fix......
Thanks in advance.
Amahi 11
Intel i7 quad core 2.8GHz
1 GiB Geforce graphics
16 GiB RAM
Sagemcom F@st 5366 tn modem/router

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: dnsmasq service failed

Postby cpg » Thu Feb 24, 2022 4:46 pm

Interestingly, I have a Sagecom F@st 5655 device as a router.

I did notice dnsmasq not dishing out DHCP leases and it was because the router was not connected to the internet due to upstream failures. However, I am running Amahi 12 and a newer DHCP, not your case (and also, it could be my HDA's networking hardware or driver acting up.

In any case, when you mention this: failed to bind DHCP server socket: Address alrea[dy in use]

This is something that we have seen occasionally happen when people install a virtualization stack, or something (like some app) that installs the virtualization stack and this starts it's own dnsmasq, which binds to the address (often earlier than this case, for some reason).

Did you install the desktop or other software that may have pulled the virtualization stack as a dependence?
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

User avatar
hemington1
Posts: 156
Joined: Mon Nov 26, 2012 6:38 pm
Location: Perth Western Australia

Re: dnsmasq service failed

Postby hemington1 » Thu Feb 24, 2022 7:07 pm

Hi CPG, thanks for the reply.
Google searches were pointing in that direction, I came across an Amahi Wiki 'Virtualization Stack Breaks DNS/DHCP Server'.
Disabling libvirtd, and rebooting the server fixed the issue. Dnsmasq started and ran as intended.
I checked all dnsmasq config files and all addressed present and correct.
Pinging the router and Yahoo from the server worked.
I turned off the router DHCP and server is now issuing leases normally.
I have not installed a virtualization stack, but that's not to say my son hasn't at some point. He is always tinkering with his desktop and Raspberry Pi............
Now I know what to do if this happens again. :D
PS. Teenagers have a particular DNA strand (sometimes kept into adulthood) "Deny everything and admit to nothing".
Amahi 11
Intel i7 quad core 2.8GHz
1 GiB Geforce graphics
16 GiB RAM
Sagemcom F@st 5366 tn modem/router

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: dnsmasq service failed

Postby cpg » Fri Feb 25, 2022 1:31 am

Aha. Glad you got it solved! :)

Unfortunately, a few things things (possibly desktop) pull in all the virt stuff and it's hard to prevent from our side.
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

Who is online

Users browsing this forum: No registered users and 7 guests