Pi-hole no web interface access and lighttpd.service failed to start

Check journalctl -u lighttpd -l again

-- Logs begin at Mon 2018-11-05 13:17:01 WIB, end at Tue 2018-11-06 00:05:01 WIB. --
Nov 05 13:17:13 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:14 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:14 orangepizero lighttpd[957]: 2018-11-05 13:17:14: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:14 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:14 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:14 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:15 orangepizero lighttpd[984]: 2018-11-05 13:17:14: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:15 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:15 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:15 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:15 orangepizero lighttpd[1016]: 2018-11-05 13:17:15: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:15 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:15 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:16 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:16 orangepizero lighttpd[1037]: 2018-11-05 13:17:16: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:16 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:16 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:16 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:17 orangepizero lighttpd[1058]: 2018-11-05 13:17:16: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:17 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:17 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:17 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
lines 1-39

Nothing new has been written to the log. Check the permissions on the error file again, and its contents.

orangepione@orangepizero:~$ sudo ls -l /var/log/lighttpd/error.log
-rw-r--r-- 1 www-data www-data 122 Nov 4 06:25 /var/log/lighttpd/error.log

sudo nano /var/log/lighttpd/error.log
2018-11-02 13:17:11: (log.c.217) server started
2018-11-04 06:25:04: (server.c.1534) logfiles cycled UID = 0 PID = 1772

orangepione@orangepizero:~$ sudo stat -c "%a %n" /var/log/lighttpd/error.log
[sudo] password for orangepione:
644 /var/log/lighttpd/error.log

$ sudo stat /var/log/lighttpd/error.log
File: /var/log/lighttpd/error.log
Size: 122 Blocks: 8 IO Block: 4096 regular file
Device: fe00h/65024d Inode: 40 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 33/www-data) Gid: ( 33/www-data)
Access: 2018-11-05 23:44:22.000000000 +0700
Modify: 2018-11-04 06:25:05.000000000 +0700
Change: 2018-11-05 23:04:17.000000000 +0700
Birth: -

Try sudo systemctl restart lighttpd

sorry for late reply, felt in sleep,
sudo systemctl restart lighttpd
no output

and
sudo systemctl status lighttpd
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-11-06 09:43:30 WIB; 5min ago
Process: 9388 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
Process: 9378 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Main PID: 9388 (code=exited, status=255)

Nov 06 09:43:30 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 06 09:43:30 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 06 09:43:30 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 06 09:43:30 orangepizero systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 06 09:43:30 orangepizero systemd[1]: Failed to start Lighttpd Daemon.
Nov 06 09:43:30 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 06 09:43:30 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.

Check the contents of /var/log/lighttpd/error.log and the output of this command again: journalctl -u lighttpd -l

The error should be getting logged somewhere.

/var/log/lighttpd/error.log

2018-11-02 13:17:11: (log.c.217) server started
2018-11-04 06:25:04: (server.c.1534) logfiles cycled UID = 0 PID = 1772

and

Nov 06 10:35:37 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 06 10:35:37 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 06 10:35:37 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 06 10:35:37 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 06 10:35:37 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 06 10:35:37 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 06 10:35:37 orangepizero lighttpd[9821]: 2018-11-06 10:35:37: (log.c.171) opening errorlog '/var/log/lig
Nov 06 10:35:37 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 06 10:35:37 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 06 10:35:37 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 06 10:35:37 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 06 10:35:37 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 06 10:35:37 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 06 10:35:37 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 06 10:35:38 orangepizero lighttpd[9842]: 2018-11-06 10:35:37: (log.c.171) opening errorlog '/var/log/lig
Nov 06 10:35:38 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 06 10:35:38 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 06 10:35:38 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 06 10:35:38 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 06 10:35:38 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 06 10:35:38 orangepizero systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 06 10:35:38 orangepizero systemd[1]: Failed to start Lighttpd Daemon.
Nov 06 10:35:38 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 06 10:35:38 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.

Try temporarily making the error log world-writeable: sudo chmod 777 /var/log/lighttpd/error.log

orangepione@orangepizero:~$ sudo chmod 777 /var/log/lighttpd/error.log
orangepione@orangepizero:~$ sudo systemctl restart lighttpd
orangepione@orangepizero:~$ sudo systemctl status lighttpd

● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2018-11-06 11:33:03 WIB; 9s ago
  Process: 10429 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 10419 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/S
 Main PID: 10429 (code=exited, status=255)

Nov 06 11:33:03 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 06 11:33:03 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 06 11:33:03 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 06 11:33:03 orangepizero systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 06 11:33:03 orangepizero systemd[1]: Failed to start Lighttpd Daemon.
Nov 06 11:33:03 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 06 11:33:03 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.

and
sudo nano /var/log/lighttpd/error.log

2018-11-02 13:17:11: (log.c.217) server started
2018-11-04 06:25:04: (server.c.1534) logfiles cycled UID = 0 PID = 1772

OK, I think I found the problem. Permissions in /var/log$ sudo ls -la lighttpd/

total 4320
drwxr-x--- 2 root     root        4096 Nov  6 13:52 .
drwxr-xr-x 8 root     root        4096 Nov  6 00:00 ..
-rw-r--r-- 1 root     root     4408939 Nov  3 23:32 access.log
-rwxrwxrwx 1 www-data www-data     122 Nov  6 10:36 error.log

did a

orangepione@orangepizero:/var/log$ sudo chown -R www-data:www-data lighttpd/
orangepione@orangepizero:/var/log$ sudo ls -la lighttpd/

total 4320
drwxr-x--- 2 www-data www-data    4096 Nov  6 13:52 .
drwxr-xr-x 8 root     root        4096 Nov  6 00:00 ..
-rw-r--r-- 1 www-data www-data 4408939 Nov  3 23:32 access.log
-rwxrwxrwx 1 www-data www-data     122 Nov  6 10:36 error.log

and than

/var/log$ sudo service lighttpd restart
orangepione@orangepizero:/var/log$ sudo systemctl status lighttpd -l

● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-11-06 14:15:42 WIB; 19s ago
  Process: 11851 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/S
 Main PID: 11861 (lighttpd)
    Tasks: 6 (limit: 4915)
   CGroup: /system.slice/lighttpd.service
           ├─11861 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
           ├─11871 /usr/bin/php-cgi
           ├─11872 /usr/bin/php-cgi
           ├─11873 /usr/bin/php-cgi
           ├─11874 /usr/bin/php-cgi
           └─11875 /usr/bin/php-cgi

Nov 06 14:15:42 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 06 14:15:42 orangepizero systemd[1]: Started Lighttpd Daemon.

Web interface accessible, did a reboot and still running, log files refreshing too,

Thanks to @Mcat12 @RamSet and @DanSchaper for great help and patience with me(still a noob) and the problem.

1 Like

Same occurred for me on my Orange PI last week.
Orange Pi zero is sort of unstable for me, it shuts down every 2-3 weeks, moving back to RPi 2 soon.

well, this didn't effect the pihole or dns over http, all was fine. I running two units in different locations for about 3 month and this was the first time problem. we experience a lot of blackouts here where I live( 1or 2 a day) and I'm really surprised how well the units still perform. By now I really don't see the need to change the board as we only run pi-hole on it but I will make a backup of the image for the future and just replace the sd card if some more trouble comes up. I got a raspberry 3 too but we use it for gaming and entertainment. cheers

As Pi's don't always respond well to power loss, you might consider putting your Pi's on a battery backup (UPS or similar). With the low power draw of those units, the backup supply doesn't need to be very large.

1 Like

yes you very right @jfb I thought about it and I will do it for sure, thinking about a little power-bank but can they simultaneous charging/discharging? still looking for a cheap solution, any ideas are very welcome , thanks and cheers

I got started reading these, so many I haven't gotten far enough to choose one.

https://duckduckgo.com/?q=raspberry+pi+ups&t=opensuse&ia=web

Amazon has a good selection: (search says "too many words" but it finds several different groups of devices below that)

https://smile.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=raspberry+pi+ups+battery+backup

I haven't used any of the power packs that charge while the Pi is plugged into them. I have two UPS in my house (one for router/modem/home automation hub), and the other for my office (computers, drives, etc.). I have four Pi's plugged into those two UPS. Since I already had the UPS, this was my least expensive solution.

For some Pi's, you can get battery backup hats. These have a pretty small battery and software to shut the Pi down when power is lost. Not intended to keep it running for long, just to let it close open files and shutdown gracefully.

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