BeagleBone Black FATAL ERROR in dnsmasq core: cannot open or create lease file /var/lib/misc/dnsmasq.leases: Permission denied

Hi,

I'm trying to get pihole running on a BeagleBone Black with Debian, but pihole status always returns:

[✗] DNS service is NOT running
[✗] DNS service is NOT running

Removing dnsmasq got rid of a lot of errors, but the following stil shows up in pihole debug:

FATAL ERROR in dnsmasq core: cannot open or create lease file /var/lib/misc/dnsmasq.leases: Permission denied

https://tricorder.pi-hole.net/StO6tMkW/

Any ideas?

Your debug log suggests you are running some other software trying to control dnsmsasq options next to Pi-hole:

-rw-r--r-- 1 root root 336 Nov  7 06:43 /etc/dnsmasq.d/SoftAp0
   interface=usb0
   interface=usb1
   port=53
   dhcp-authoritative
   domain-needed
   bogus-priv
   expand-hosts
   dhcp-range=usb0,192.168.7.1,192.168.7.1,2m
   dhcp-range=usb1,192.168.6.1,192.168.6.1,2m
   listen-address=127.0.0.1
   listen-address=192.168.7.2
   listen-address=192.168.6.2
   dhcp-option=usb0,3
   dhcp-option=usb0,6
   dhcp-option=usb1,3
   dhcp-option=usb1,6

Pi-hole's embedded pihole-FTL is a replacement for dnsmasq, so your additional software package is now also trying to configure Pi-hole.
This will only work as long as those extra cofigurations are not conflicting with PI-hole's own settings.

It may be possible that they can coexist that way, but you'd have to figure yourself by manually altering configs.
That said, I'd explicitly advise against altering Pi-hole's, as that will be overwritten upon updates and repairs.

Your immediate issue is that pihole-FTL has no permission to access the lease file as written by your previous dnsmasq instance when that was still active.
Pi-hole's own default location for its DHCP lease fle would be /etc/pihole/dhcp.leases - provided its DHCP server would be activated.

I'd suggest to try and enable Pi-hole's DHCP server first and try to get your SoftAP cooperating.

To get you started with that:
Upon first glance, your config would be inviting further conflicts.
In your /etc/dnsmasq.d/SoftAp0, you should at least remove all interface and listen-address options. In fact, I'd probably only keep the dhcp-range and dhcp-option lines.

The following command may come in handy, for checking your dnsmasq configuration syntax:

 pihole-FTL dnsmasq-test

If your SoftAp software is also writing the configs upon updates, I'd recommend to install it on another machine.

(But if you're in for a challenge: It may also be possible to reinstall dnsmasq and have it read its configuration from a different file location, plus you'd then need to employ bind-interfaces for both Pi-hole and dnsmasq, to have them coexist with clean separate configurations on your machine.)

1 Like

Thanks for all the detailed info! Didn't realize another app besides dnsmasq could be involved here. I'll keep digging. :pensive:

So I got pihole temporarily working with:

sudo touch /var/lib/misc/dnsmasq.leases
sudo chown pihole:pihole /var/lib/misc/dnsmasq.leases
sudo systemctl restart pihole-FTL

But /var/lib/misc/dnsmasq.leases does not exist after rebooting and pihole-FTL still shows the original error.

That's not quite what I was suggesting:

Did that fail?

Did that fail?

No. Enabling DHCP on pihole and disabling dhcp on my router gets pihole status to report it is working.

But the network got pretty wonky after that. Need to find the time to start from scratch and re-check all the settings again, but for now I need to put this project on hold.

Thanks for your help!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.