Dnsmasq restart hangs

root@storage:/var/log# apt-cache depends systemd
systemd
PreDepends: libc6
PreDepends: libgcrypt20
PreDepends: liblzma5
PreDepends: libselinux1
Depends: libacl1
Depends: libapparmor1
Depends: libaudit1
Depends: libblkid1
Depends: libcap2
Depends: libcryptsetup4
Depends: libgpg-error0
Depends: libkmod2
Depends: libmount1
Depends: libpam0g
Depends: libseccomp2
Depends: libselinux1
Depends: libsystemd0
Depends: util-linux
util-linux:i386
Depends: mount
mount:i386
Depends: adduser
Depends: libcap2-bin
libcap2-bin:i386
Conflicts:
Conflicts: systemd-services
Breaks: apparmor
Breaks: ifupdown
Breaks: lsb-base
Breaks: lvm2
Breaks: systemd-shim
Breaks: udev
Recommends: libpam-systemd
Recommends: dbus
dbus:i386
Suggests: systemd-ui
Suggests: systemd-container
systemd-container:i386
Replaces: systemd-services
systemd:i386
systemd
Replaces: udev

apt-cache depends systemd | awk '{print $2}' | strings | dpkg -l

For the above command. I am unable to post everything in its entirety here.

Dump here:
http://paste.ubuntu.com/

Getting late
:zzz: :zzz: :zzz: :zzz:

I was having a very similar issue (or the same?) to the one described in here.

In my case I am attempting to install pi-hole on a fresh streisand installation; I must differ with the recommended steps from the official documentation on how to set pi-hole with a vpn as choosing the interface ip does not work; instead i choose one of the vpn interfaces as the main one (i've tried wg0 and tun0) but with the public ip address and gateway (as per the defaults) - it works like a charm but on reboot the dnsmasq service fails to start and the vpn interfaces would be down (although I could manually up them);

The problem is that dnsmasq installed by Streisand enters in conflict with the custom dnsmasq shipped with pihole on pihole-FTL.service, as described here

sudo systemctl stop dnsmasq.service
sudo systemctl restart pihole-FTL.service

running this commands brings all vpn interfaces back up and everything is working with pi-hole filtering on all interfaces and as closed-relay. So I've tried disabling the default dnsmasq from boot but I am faced with errors:

root@pihole:~# systemctl disable dnsmasq
Synchronizing state of dnsmasq.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install disable dnsmasq
insserv: warning: current start runlevel(s) (empty) of script dnsmasq' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script dnsmasq' overrides LSB defaults (0 1 6).
insserv: warning: current start runlevel(s) (empty) of script dnsmasq' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script dnsmasq' overrides LSB defaults (0 1 6).

root@pihole:~# update-rc.d dnsmasq disable
insserv: warning: current start runlevel(s) (empty) of script dnsmasq' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script dnsmasq' overrides LSB defaults (0 1 6).

My solutions was to remove the systemd and init.d scripts for dnsmasq (I'm hoping there is a better suggestion on how to deal with it?)

rm /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/dnsmasq.service
rm /etc/init.d/dnsmasq
rm /etc/systemd/system/dnsmasq.service.d

Everything seems to work correctly now and the server is not working as an open-relay.

Dont need dnsmasq anymore (except maybe for the man page):

sudo apt remove dnsmasq-base

1 Like

Thanks for the hint.

Doesn't pi-hole detect and automatically uninstall a previous version of dnsmasq if it conflicts in this way?

1 Like

Me like automated installs.
Me dont like automated installs that uninstall.
Who knows what might break :wink:

1 Like

Well, I guess now we know :smile: Sometimes not uninstalling also breaks things; and dnsmasq is usually installed unless one is dedicating an entire instance to Pi-Hole (at least on my servers)

In this specific case Pi-Hole works nicely with Streisand but one must uninstall the default dnsmaq; the FTL seems to pick up on all interface configurations done by Streisand as they all come back up once dnsmasq is disabled and FTL enabled. In fact, without logs and on anonymous mode, Pi-Hole should definitely be incorporated into the streisand project imho.

All distro's that I know of, Debian/Raspbian/Armbian/TinkerOS , RH/CENTOS, Suse, dont install any DNS daemon with a basic light install.
And you can install lots of software on the side as long as they dont conflict.
And if they conflict, you could containerise like for example with Docker.

pihole-FTL is exactly the same code as dnsmasq with a special Pi-hole sause on top :yum: