Upgrading to v6 (pihole -up) didn't disable lighttpd

I had been happily running bog standard, up-to-date v5 on my rasberrypi5. I don't recall making any modifications to the default v5 config generated during initial setup or subsequent updates as they were offered and installed.

After successfully upgrading to v6, my pi-hole admin (http://192.168.2.123/admin/) no longer worked (returned a 403). After digging around the v6 release notes and such it would seem v6 uses a new HTTPD and the upgrade was supposed to have asked me whether I wanted to disable (the old) lighttpd? But it did not. And lighttpd was still running. I rebooted. Same issue. After googling how to use systemctl to stop and disable lighttpd and rebooting, http://192.168.2.123/admin/ now works as expected. I was panicking there for a bit.

Fingers crossed nothing else was missed during the upgrade. v6 seems to be running like a champ now. I'll be keeping an eye on it.

UPDATE:
I forgot to mention that after the upgrade my backend DNS servers were blank and the local DNS records I'd added were gone. So I guess my v5 config wasn't carried forward? Anyway, since there might be other stuff that got missed, I decided to take the lazy way out and repave. I got a new SDcard, imaged it with the latest PiOS Lite and booted off it. Then installed a new copy of pi-hole, configured the backend DNS servers and added my local DNS records. I'm back up and running.

I know, I know. I should've read the release notes more carefully and backed up my config, but retirement has made me soft. Lesson learned. First thing I did was teleport my config. :slight_smile:

2 Likes

This is the exact issue I ran into.

The Pi-hole v5 > v6 upgrade did NOT go to plan & bombed out unable to resolve DNS lookups (the DNS was configured as Unbound on 127.0.0.1#5335 on the same Raspberry Pi Pi-hole v5 was running on).

I tried rebooting & restarting the upgrade to v6 and things went more 'pear-shaped' but eventually I found how to manually edit the host configuration so I could change the nameserver to 1.1.1.1 instead of the hosts IP address & rerun the v6 upgrade. Eventually everything seemed to complete but I wasn't able to open the Pi-hole v6 web interface & kept getting "403" error & browsing to the host IP told me lighttpd was running (possibly because my original Pi-hole v5 was installed from DietPi).

To stop & remove lighttpd, I did:

sudo service lighttpd stop
sudo apt remove lighttpd

then rebooted & eventually my Pi-hole v6 web page was accessible. All of my configuration from my v5 was gone, so I had to reset my Pi-hole password & restore the Teleporter backup I had taken from my v5.

Honestly, I expected the v5 to v6 upgrade to be painless, but it was anything but.

Same here.
As I don't need lighttpd any longer I confirmed the script to delete but it doesn't.
As a consequence the login to admin page failed.

I then thought I should re-edit my /etc/resolv.conf back to say nameserver 127.0.0.1 (or the host IP address) but then I ran into DNS problems.

This post:

suggests leaving a public DNS IP in the /etc/resolv.conf but now I'm unsure if it should say

nameserver 127.0.0.1 or nameserver 127.0.0.1#5335 or keep it as 1.1.1.1 (Cloudflare public DNS).

Shouldn't the Pi-hole v5 to v6 update have sorted all this?

All went fine. My DNS was and is 127.0.0.1#5335 for the use of unbound service.

I use Raspi OS Lite, Not dietpi.

In PiHole web interface, my DNS nameserver is given as 127.0.0.1#5335

But in /etc/resolve.conf it's just given as 127.0.0.1

I presume this is correct?
I do think there are some issues upgrading Pi-hole v5 to v6 when it's specifically installed on DietPi with Unbound.

Is it possible that the update was called via pipe? The prompt to disable Lighttpd is only done if the service is enabled (systemctl is-enabled lighttpd) and if STDIN is attacked to a terminal. In a pipe, the latter is not true:

root@micha:~# echo '[[ -t 0 ]] && echo yes || echo no' | bash -s
no

From my MacOS terminal window I ssh'd to my rasberrypi5 to the default PiOS interactive shell (bash) and invoked the command "pihole -up" as instructed by the "upgrade available" notification on the pi-hole webadmin page. No pipe was involved.

I tested it a few times, and always got offered to disable Lighttpd. The installer is not called via pipe.

If someone faces the same, or has a backup with Pi-hole v5, would be interesting to check:

systemctl is-enabled lighttpd

This not being/returning enabled is the only other condition, in which case it is not offered, at least the only one I can see in the code.

I wish I could provide more information. But that's it. lighttpd was definitely running because the the /admin/ webpage notice that the upgrade was available was hosted by that same lighttpd. I was taken a bit back that I had to login to an interactive shell to perform a CLI update. I could've sworn all previous updates happened via the /admin/ webpage (MY RECOLLECTION HERE IS INCORRECT. UPDATES HAVE ALWAYS BEEN VIA CLI. SEE BELOW). I could be mistaken about that. Unfortunately I have no proof of that nor anything to look into now as I repaved the device to make sure everything would be OK going forward. Sorry.

Did the "pi-hole -up" generate any error messages? I can't imagine I wouldn't have noticed that. I've been doing stuff like this for over 30 yrs. But again, no proof. I wish I'd captured the output but I didn't see any reason to.

AFAIK there is no update function via admin page. It is intentionally intended only via CLI.

Theoretically, Lighttpd could be also disabled and started in other ways at boot time. DietPi e.g. worked like this in the past. Or the systemctl command could return false for other reasons, some error or whatnot. Hence the manual check one time, for those who are still in the position to test it.

Turns out I do still have the sdcard that I was using. The "repave" wasn't quite true. I didn't repave the sdcard. I used a new one. Is there a way to mount the sdcard and take a look at it's contents that might shed some light? I tried using my Windows machine, it only shows me the bootfs. Same with trying it on my Mac mini. I don't want boot off the old sdcard and impact the house network usability.

On Windows you have no access indeed and an SBC has a single SD card slot only, usually. Do you have a USB-SD adapter?

Btw, the missing Lighttpd disable prompt might have been caused indirectly by other issues, solved with latest Pi-hole v6.0.4. At least here it was now offered, while it was not before: Testing upgrade from V5 to V6 / problems / repeatable - #16 by chrislph

I have a USB-A thingy that I can insert the sdcard into. It's in the pi. I'm trying to remember how to mount shit. My retired brain has gotten mushy. googling

1 Like

Woohoo! I'm in. Is there something from it I can provide that might help? Or is this just busy work?

$ sudo mount -r /dev/sda2 /mnt/usba2
$ cd /mnt/usba2
$ ls -al
total 84
drwxr-xr-x 18 root root  4096 Feb 24  2024 .
drwxr-xr-x  3 root root  4096 Feb 23 00:10 ..
lrwxrwxrwx  1 root root     7 Dec 11  2023 bin -> usr/bin
drwxr-xr-x  3 root root  4096 Feb 24  2024 boot
drwxr-xr-x  4 root root  4096 Dec 11  2023 dev
drwxr-xr-x 96 root root  4096 Feb 21 05:41 etc
drwxr-xr-x  3 root root  4096 Feb 24  2024 home
lrwxrwxrwx  1 root root    33 Feb 24  2024 initrd.img -> boot/initrd.img-6.1.0-rpi8-rpi-v8
lrwxrwxrwx  1 root root    35 Feb 24  2024 initrd.img.old -> boot/initrd.img-6.1.0-rpi8-rpi-2712
lrwxrwxrwx  1 root root     7 Dec 11  2023 lib -> usr/lib
drwx------  2 root root 16384 Dec 11  2023 lost+found
drwxr-xr-x  2 root root  4096 Dec 11  2023 media
drwxr-xr-x  2 root root  4096 Dec 11  2023 mnt
drwxr-xr-x  4 root root  4096 Feb 24  2024 opt
drwxr-xr-x  2 root root  4096 Dec  9  2023 proc
drwx------  4 root root  4096 Feb 21 04:51 root
drwxr-xr-x  8 root root  4096 Dec 11  2023 run
lrwxrwxrwx  1 root root     8 Dec 11  2023 sbin -> usr/sbin
drwxr-xr-x  2 root root  4096 Dec 11  2023 srv
drwxr-xr-x  2 root root  4096 Dec  9  2023 sys
drwxrwxrwt  6 root root  4096 Feb 21 17:32 tmp
drwxr-xr-x 11 root root  4096 Dec 11  2023 usr
drwxr-xr-x 12 root root  4096 Feb 24  2024 var
lrwxrwxrwx  1 root root    30 Feb 24  2024 vmlinuz -> boot/vmlinuz-6.1.0-rpi8-rpi-v8
lrwxrwxrwx  1 root root    32 Feb 24  2024 vmlinuz.old -> boot/vmlinuz-6.1.0-rpi8-rpi-2712

Can you check this:

ls -l /mnt/usba2/etc/systemd/system/*wants/lighttpd.service
ls -l /mnt/usba2/etc/systemd/system/lighttpd.service
$ ls -l /mnt/usba2/etc/systemd/system/*wants/lighttpd.service
ls: cannot access '/mnt/usba2/etc/systemd/system/*wants/lighttpd.service': No such file or directory
$ sudo ls -l /mnt/usba2/etc/systemd/system/*wants/lighttpd.service
ls: cannot access '/mnt/usba2/etc/systemd/system/*wants/lighttpd.service': No such file or directory
$ ls -l /mnt/usba2/etc/systemd/system/lighttpd.service
ls: cannot access '/mnt/usba2/etc/systemd/system/lighttpd.service': No such file or directory
$ sudo ls -l /mnt/usba2/etc/systemd/system/lighttpd.service
ls: cannot access '/mnt/usba2/etc/systemd/system/lighttpd.service': No such file or directory

And just for good measure:

/mnt/usba2/etc/systemd $ find . -print | xargs ls -ld
drwxr-xr-x  5 root root 4096 Feb 24  2024 .
-rw-r--r--  1 root root 1282 Nov  9  2023 ./journald.conf
-rw-r--r--  1 root root 1539 Feb 24  2024 ./logind.conf
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./network
lrwxrwxrwx  1 root root    9 Dec 10  2023 ./network/73-usb-net-by-mac.link -> /dev/null
lrwxrwxrwx  1 root root    9 Dec 10  2023 ./network/99-default.link -> /dev/null
-rw-r--r--  1 root root  846 Nov  9  2023 ./networkd.conf
-rw-r--r--  1 root root  670 Nov  9  2023 ./pstore.conf
-rw-r--r--  1 root root  953 Nov  9  2023 ./sleep.conf
drwxr-xr-x 16 root root 4096 Feb 20 22:26 ./system
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/bluetooth.target.wants
lrwxrwxrwx  1 root root   37 Dec 10  2023 ./system/bluetooth.target.wants/bluetooth.service -> /lib/systemd/system/bluetooth.service
-rw-r--r--  1 root root 2080 Nov  9  2023 ./system.conf
lrwxrwxrwx  1 root root   42 Dec 10  2023 ./system/dbus-fi.w1.wpa_supplicant1.service -> /lib/systemd/system/wpa_supplicant.service
lrwxrwxrwx  1 root root   37 Dec 10  2023 ./system/dbus-org.bluez.service -> /lib/systemd/system/bluetooth.service
lrwxrwxrwx  1 root root   40 Dec 10  2023 ./system/dbus-org.freedesktop.Avahi.service -> /lib/systemd/system/avahi-daemon.service
lrwxrwxrwx  1 root root   40 Dec 10  2023 ./system/dbus-org.freedesktop.ModemManager1.service -> /lib/systemd/system/ModemManager.service
lrwxrwxrwx  1 root root   53 Dec 10  2023 ./system/dbus-org.freedesktop.nm-dispatcher.service -> /lib/systemd/system/NetworkManager-dispatcher.service
lrwxrwxrwx  1 root root   45 Dec 10  2023 ./system/dbus-org.freedesktop.timesync1.service -> /lib/systemd/system/systemd-timesyncd.service
lrwxrwxrwx  1 root root   37 Feb 24  2024 ./system/default.target -> /lib/systemd/system/multi-user.target
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/dev-serial1.device.wants
lrwxrwxrwx  1 root root   35 Dec 10  2023 ./system/dev-serial1.device.wants/hciuart.service -> /lib/systemd/system/hciuart.service
drwxr-xr-x  2 root root 4096 Feb 24  2024 ./system/getty.target.wants
lrwxrwxrwx  1 root root   34 Feb 24  2024 ./system/getty.target.wants/getty@tty1.service -> /lib/systemd/system/getty@.service
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/getty@tty1.service.d
-rw-r--r--  1 root root   30 Dec 10  2023 ./system/getty@tty1.service.d/noclear.conf
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/graphical.target.wants
lrwxrwxrwx  1 root root   35 Dec 10  2023 ./system/graphical.target.wants/udisks2.service -> /lib/systemd/system/udisks2.service
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/halt.target.wants
lrwxrwxrwx  1 root root   49 Dec 10  2023 ./system/halt.target.wants/rpi-display-backlight.service -> /lib/systemd/system/rpi-display-backlight.service
drwxr-xr-x  2 root root 4096 Feb 20 22:51 ./system/multi-user.target.wants
lrwxrwxrwx  1 root root   40 Dec 10  2023 ./system/multi-user.target.wants/avahi-daemon.service -> /lib/systemd/system/avahi-daemon.service
lrwxrwxrwx  1 root root   41 Dec 10  2023 ./system/multi-user.target.wants/console-setup.service -> /lib/systemd/system/console-setup.service
lrwxrwxrwx  1 root root   32 Dec 10  2023 ./system/multi-user.target.wants/cron.service -> /lib/systemd/system/cron.service
lrwxrwxrwx  1 root root   42 Dec 10  2023 ./system/multi-user.target.wants/dphys-swapfile.service -> /lib/systemd/system/dphys-swapfile.service
lrwxrwxrwx  1 root root   40 Dec 10  2023 ./system/multi-user.target.wants/e2scrub_reap.service -> /lib/systemd/system/e2scrub_reap.service
lrwxrwxrwx  1 root root   40 Dec 10  2023 ./system/multi-user.target.wants/ModemManager.service -> /lib/systemd/system/ModemManager.service
lrwxrwxrwx  1 root root   38 Dec 10  2023 ./system/multi-user.target.wants/networking.service -> /lib/systemd/system/networking.service
lrwxrwxrwx  1 root root   42 Dec 10  2023 ./system/multi-user.target.wants/NetworkManager.service -> /lib/systemd/system/NetworkManager.service
lrwxrwxrwx  1 root root   37 Dec 10  2023 ./system/multi-user.target.wants/nfs-client.target -> /lib/systemd/system/nfs-client.target
lrwxrwxrwx  1 root root   38 Feb 24  2024 ./system/multi-user.target.wants/pihole-FTL.service -> /etc/systemd/system/pihole-FTL.service
lrwxrwxrwx  1 root root   36 Dec 10  2023 ./system/multi-user.target.wants/remote-fs.target -> /lib/systemd/system/remote-fs.target
lrwxrwxrwx  1 root root   45 Dec 10  2023 ./system/multi-user.target.wants/rpi-eeprom-update.service -> /lib/systemd/system/rpi-eeprom-update.service
lrwxrwxrwx  1 root root   31 Feb 24  2024 ./system/multi-user.target.wants/ssh.service -> /lib/systemd/system/ssh.service
lrwxrwxrwx  1 root root   37 Dec 10  2023 ./system/multi-user.target.wants/sshswitch.service -> /lib/systemd/system/sshswitch.service
lrwxrwxrwx  1 root root   40 Dec 10  2023 ./system/multi-user.target.wants/triggerhappy.service -> /lib/systemd/system/triggerhappy.service
lrwxrwxrwx  1 root root   42 Dec 10  2023 ./system/multi-user.target.wants/wpa_supplicant.service -> /lib/systemd/system/wpa_supplicant.service
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/network-online.target.wants
lrwxrwxrwx  1 root root   38 Dec 10  2023 ./system/network-online.target.wants/networking.service -> /lib/systemd/system/networking.service
lrwxrwxrwx  1 root root   54 Dec 10  2023 ./system/network-online.target.wants/NetworkManager-wait-online.service -> /lib/systemd/system/NetworkManager-wait-online.service
-rw-r--r--  1 root root 1463 Feb 20 22:26 ./system/pihole-FTL.service
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/poweroff.target.wants
lrwxrwxrwx  1 root root   49 Dec 10  2023 ./system/poweroff.target.wants/rpi-display-backlight.service -> /lib/systemd/system/rpi-display-backlight.service
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/reboot.target.wants
lrwxrwxrwx  1 root root   49 Dec 10  2023 ./system/reboot.target.wants/rpi-display-backlight.service -> /lib/systemd/system/rpi-display-backlight.service
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/remote-fs.target.wants
lrwxrwxrwx  1 root root   37 Dec 10  2023 ./system/remote-fs.target.wants/nfs-client.target -> /lib/systemd/system/nfs-client.target
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/sockets.target.wants
lrwxrwxrwx  1 root root   39 Dec 10  2023 ./system/sockets.target.wants/avahi-daemon.socket -> /lib/systemd/system/avahi-daemon.socket
lrwxrwxrwx  1 root root   39 Dec 10  2023 ./system/sockets.target.wants/triggerhappy.socket -> /lib/systemd/system/triggerhappy.socket
lrwxrwxrwx  1 root root   31 Feb 24  2024 ./system/sshd.service -> /lib/systemd/system/ssh.service
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./system/sysinit.target.wants
lrwxrwxrwx  1 root root   36 Dec 10  2023 ./system/sysinit.target.wants/apparmor.service -> /lib/systemd/system/apparmor.service
lrwxrwxrwx  1 root root   40 Dec 10  2023 ./system/sysinit.target.wants/fake-hwclock.service -> /lib/systemd/system/fake-hwclock.service
lrwxrwxrwx  1 root root   42 Dec 10  2023 ./system/sysinit.target.wants/keyboard-setup.service -> /lib/systemd/system/keyboard-setup.service
lrwxrwxrwx  1 root root   42 Dec 10  2023 ./system/sysinit.target.wants/systemd-pstore.service -> /lib/systemd/system/systemd-pstore.service
lrwxrwxrwx  1 root root   45 Dec 10  2023 ./system/sysinit.target.wants/systemd-timesyncd.service -> /lib/systemd/system/systemd-timesyncd.service
drwxr-xr-x  2 root root 4096 Feb 24  2024 ./system/timers.target.wants
lrwxrwxrwx  1 root root   35 Dec 10  2023 ./system/timers.target.wants/apt-daily.timer -> /lib/systemd/system/apt-daily.timer
lrwxrwxrwx  1 root root   43 Dec 10  2023 ./system/timers.target.wants/apt-daily-upgrade.timer -> /lib/systemd/system/apt-daily-upgrade.timer
lrwxrwxrwx  1 root root   40 Dec 10  2023 ./system/timers.target.wants/dpkg-db-backup.timer -> /lib/systemd/system/dpkg-db-backup.timer
lrwxrwxrwx  1 root root   37 Dec 10  2023 ./system/timers.target.wants/e2scrub_all.timer -> /lib/systemd/system/e2scrub_all.timer
lrwxrwxrwx  1 root root   32 Dec 10  2023 ./system/timers.target.wants/fstrim.timer -> /lib/systemd/system/fstrim.timer
lrwxrwxrwx  1 root root   35 Dec 10  2023 ./system/timers.target.wants/logrotate.timer -> /lib/systemd/system/logrotate.timer
lrwxrwxrwx  1 root root   32 Dec 10  2023 ./system/timers.target.wants/man-db.timer -> /lib/systemd/system/man-db.timer
lrwxrwxrwx  1 root root   41 Feb 24  2024 ./system/timers.target.wants/phpsessionclean.timer -> /lib/systemd/system/phpsessionclean.timer
-rw-r--r--  1 root root  864 Nov  9  2023 ./timesyncd.conf
drwxr-xr-x  3 root root 4096 Dec 10  2023 ./user
-rw-r--r--  1 root root 1415 Nov  9  2023 ./user.conf
drwxr-xr-x  2 root root 4096 Dec 10  2023 ./user/sockets.target.wants
lrwxrwxrwx  1 root root   36 Dec 10  2023 ./user/sockets.target.wants/dirmngr.socket -> /usr/lib/systemd/user/dirmngr.socket
lrwxrwxrwx  1 root root   46 Dec 10  2023 ./user/sockets.target.wants/gpg-agent-browser.socket -> /usr/lib/systemd/user/gpg-agent-browser.socket
lrwxrwxrwx  1 root root   44 Dec 10  2023 ./user/sockets.target.wants/gpg-agent-extra.socket -> /usr/lib/systemd/user/gpg-agent-extra.socket
lrwxrwxrwx  1 root root   38 Dec 10  2023 ./user/sockets.target.wants/gpg-agent.socket -> /usr/lib/systemd/user/gpg-agent.socket
lrwxrwxrwx  1 root root   42 Dec 10  2023 ./user/sockets.target.wants/gpg-agent-ssh.socket -> /usr/lib/systemd/user/gpg-agent-ssh.socket

Of course none of those symlinks are going to work 'cause they're relative to / instead of ./, but I could run them down if need be.

And that is still Pi-hole v5? Because indeed neither Lighttpd nor PHP systemd units are enabled. Are they present at all?

find /mnt/usba2/lib/systemd/system -name lighttpd.service -o -name 'php*.service' -exec ls -l {} +

The phpsessionclean.timer is enabled, so there is PHP installed, but not enabled.