Lighttpd cannot start after reboot

Expected Behaviour:

to be able to open the Web GUI on port 80

Actual Behaviour:

I get connection refused after every reboot.
pi-hole is running on bananapi zero with Ubuntu 20.04.

Nov 29 00:04:08 bpi-m2z systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/EXCEPTION
Nov 29 00:04:08 bpi-m2z systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 29 00:04:09 bpi-m2z systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Nov 29 00:04:09 bpi-m2z systemd[1]: Stopped Lighttpd Daemon.
Nov 29 00:04:09 bpi-m2z systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 29 00:04:09 bpi-m2z systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 29 00:04:09 bpi-m2z systemd[1]: Failed to start Lighttpd Daemon.

pi@bpi-m2z:~$ systemctl status lighttpd
● lighttpd.service - Lighttpd Daemon
     Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2023-11-29 00:04:09 UTC; 8min ago
    Process: 352 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
    Process: 355 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255/EXCEPTION)
   Main PID: 355 (code=exited, status=255/EXCEPTION)
pi@bpi-m2z:~$

pi@bpi-m2z:~$ sudo /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
pi@bpi-m2z:~$

the above command returns nothing.

pi@bpi-m2z:~$ sudo cat /etc/lighttpd/external.conf
cat: /etc/lighttpd/external.conf: No such file or directory
pi@bpi-m2z:~$

-----tail of error-pihole.log------
   2023-11-29 00:04:04: (server.c.1496) Configuration of plugins failed. Going down.
   2023-11-29 00:04:05: (server.c.1488) server started (lighttpd/1.4.55)
   2023-11-29 00:04:05: (gw_backend.c.499) bind failed for: unix:/run/lighttpd/pihole-php-fastcgi.socket-0 No such file or directory
   2023-11-29 00:04:05: (gw_backend.c.1490) [ERROR]: spawning gw failed.
   2023-11-29 00:04:05: (server.c.1496) Configuration of plugins failed. Going down.
   2023-11-29 00:04:07: (server.c.1488) server started (lighttpd/1.4.55)
   2023-11-29 00:04:07: (gw_backend.c.499) bind failed for: unix:/run/lighttpd/pihole-php-fastcgi.socket-0 No such file or directory
   2023-11-29 00:04:07: (gw_backend.c.1490) [ERROR]: spawning gw failed.
   2023-11-29 00:04:07: (server.c.1496) Configuration of plugins failed. Going down.
   2023-11-29 00:04:08: (server.c.1488) server started (lighttpd/1.4.55)
   2023-11-29 00:04:08: (gw_backend.c.499) bind failed for: unix:/run/lighttpd/pihole-php-fastcgi.socket-0 No such file or directory
   2023-11-29 00:04:08: (gw_backend.c.1490) [ERROR]: spawning gw failed.
   2023-11-29 00:04:08: (server.c.1496) Configuration of plugins failed. Going down.
   2023-11-29 00:07:14: (server.c.1488) server started (lighttpd/1.4.55)
   2023-11-29 00:07:14: (gw_backend.c.499) bind failed for: unix:/run/lighttpd/pihole-php-fastcgi.socket-0 No such file or directory
   2023-11-29 00:07:14: (gw_backend.c.1490) [ERROR]: spawning gw failed.
   2023-11-29 00:07:14: (server.c.1496) Configuration of plugins failed. Going down.
   2023-11-29 00:07:20: (server.c.1488) server started (lighttpd/1.4.55)
   2023-11-29 00:07:20: (gw_backend.c.499) bind failed for: unix:/run/lighttpd/pihole-php-fastcgi.socket-0 No such file or directory
   2023-11-29 00:07:20: (gw_backend.c.1490) [ERROR]: spawning gw failed.
   2023-11-29 00:07:20: (server.c.1496) Configuration of plugins failed. Going down.
   2023-11-29 00:14:03: (server.c.1488) server started (lighttpd/1.4.55)
   2023-11-29 00:14:03: (gw_backend.c.499) bind failed for: unix:/run/lighttpd/pihole-php-fastcgi.socket-0 No such file or directory
   2023-11-29 00:14:03: (gw_backend.c.1490) [ERROR]: spawning gw failed.
   2023-11-29 00:14:03: (server.c.1496) Configuration of plugins failed. Going down.

If I execute "pihole -r" everything starts working again until next reboot.
This happens every time I reboot the board.
What could be the reason?

Debug Token:

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

After a reboot?

sudo grep -v '^ *#\|^$' /etc/lighttpd/{,conf-enabled/}*.conf

What version?

sudo lighttpd -v

This seems a permission (or ownership) problem.

pihole -r fix permissions and ownership of some files (including some files used by lighttpd).

When the error happens again, please run this command:

ls -la /run/lighttpd

Does the file exist? What is the output?
Then run pihole -r and repeat ls -la /run/lighttpd. What is the new output?

The strange thing is that "ls -la /run/lighttpd" returns this:

pi@bpi-m2z:~$ sudo lighttpd -v
lighttpd/1.4.55 (ssl) - a light and fast webserver
pi@bpi-m2z:~$ ls -la /run/lighttpd
ls: cannot access '/run/lighttpd': No such file or directory
pi@bpi-m2z:~$ sudo ls -la /run/lighttpd
ls: cannot access '/run/lighttpd': No such file or directory

After repair I see the file:

pi@bpi-m2z:/run$ sudo ls -la /run/lighttpd
total 0
drwxr-xr-x  2 www-data www-data  60 Nov 29 13:45 .
drwxr-xr-x 19 root     root     560 Nov 29 13:45 ..
srwxr-xr-x  1 www-data www-data   0 Nov 29 13:45 pihole-php-fastcgi.socket-0
pi@bpi-m2z:/run$

Then again after the reboot:

pi@bpi-m2z:~$ sudo ls -la /run/lighttpd
[sudo] password for pi:
ls: cannot access '/run/lighttpd': No such file or directory
pi@bpi-m2z:~$ sudo ls -la /run/
total 20
drwxr-xr-x 17 root   root    500 Nov 29 13:49 .
drwxrwxr-x 18 ubuntu ubuntu 4096 Mar 27  2021 ..
drwxr-xr-x  3 root   root     60 Nov 29 13:49 NetworkManager
-rw-------  1 root   root      0 Nov 29 13:49 agetty.reload
drwxr-xr-x  2 root   root     80 Nov 29 13:49 console-setup
-rw-r--r--  1 root   root      4 Nov 29 13:49 crond.pid
----------  1 root   root      0 Nov 29 13:49 crond.reboot
drwxr-xr-x  2 root   root     60 Nov 29 13:49 dbus
prw-------  1 root   root      0 Nov 29 13:49 initctl
drwxrwxrwt  2 root   root     40 Nov 29 13:49 lock
drwxr-xr-x  3 root   root     60 Nov 29 13:49 log
-rw-r--r--  1 root   root    206 Nov 29 13:49 motd.dynamic
drwxr-xr-x  2 root   root     80 Nov 29 13:49 mount
drwx------  2 root   root     60 Nov 29 13:49 netplan
drwxr-xr-x  2 pihole pihole   60 Nov 29 13:49 pihole
-rw-r--r--  1 pihole pihole    3 Nov 29 13:49 pihole-FTL.pid
lrwxrwxrwx  1 root   root      8 Nov 29 13:49 shm -> /dev/shm
drwxr-xr-x  2 root   root     40 Nov 29 13:49 sshd
-rw-r--r--  1 root   root      4 Nov 29 13:49 sshd.pid
drwxr-xr-x  3 root   root     60 Nov 29 13:50 sudo
drwxr-xr-x 20 root   root    480 Nov 29 13:49 systemd
drwxr-xr-x  2 root   root     60 Nov 29 13:49 tmpfiles.d
drwxr-xr-x  7 root   root    160 Nov 29 13:50 udev
drwxr-xr-x  3 root   root     60 Nov 29 13:49 user
drwxr-x---  2 root   root     80 Nov 29 13:49 wpa_supplicant
pi@bpi-m2z:~$

I have no idea why it's missing after the reboot...

Here you go:

pi@bpi-m2z:~$ sudo grep -v '^ *#\|^$' /etc/lighttpd/{,conf-enabled/}*.conf
/etc/lighttpd/lighttpd.conf:server.modules = (
/etc/lighttpd/lighttpd.conf:    "mod_indexfile",
/etc/lighttpd/lighttpd.conf:    "mod_access",
/etc/lighttpd/lighttpd.conf:    "mod_alias",
/etc/lighttpd/lighttpd.conf:    "mod_redirect",
/etc/lighttpd/lighttpd.conf:)
/etc/lighttpd/lighttpd.conf:server.document-root        = "/var/www/html"
/etc/lighttpd/lighttpd.conf:server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
/etc/lighttpd/lighttpd.conf:server.errorlog             = "/var/log/lighttpd/error.log"
/etc/lighttpd/lighttpd.conf:server.pid-file             = "/run/lighttpd.pid"
/etc/lighttpd/lighttpd.conf:server.username             = "www-data"
/etc/lighttpd/lighttpd.conf:server.groupname            = "www-data"
/etc/lighttpd/lighttpd.conf:server.port                 = 80
/etc/lighttpd/lighttpd.conf:server.http-parseopts = (
/etc/lighttpd/lighttpd.conf:  "header-strict"           => "enable",# default
/etc/lighttpd/lighttpd.conf:  "host-strict"             => "enable",# default
/etc/lighttpd/lighttpd.conf:  "host-normalize"          => "enable",# default
/etc/lighttpd/lighttpd.conf:  "url-normalize-unreserved"=> "enable",# recommended highly
/etc/lighttpd/lighttpd.conf:  "url-normalize-required"  => "enable",# recommended
/etc/lighttpd/lighttpd.conf:  "url-ctrls-reject"        => "enable",# recommended
/etc/lighttpd/lighttpd.conf:  "url-path-2f-decode"      => "enable",# recommended highly (unless breaks app)
/etc/lighttpd/lighttpd.conf:  "url-path-dotseg-remove"  => "enable",# recommended highly (unless breaks app)
/etc/lighttpd/lighttpd.conf:)
/etc/lighttpd/lighttpd.conf:index-file.names            = ( "index.php", "index.html" )
/etc/lighttpd/lighttpd.conf:url.access-deny             = ( "~", ".inc" )
/etc/lighttpd/lighttpd.conf:static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
/etc/lighttpd/lighttpd.conf:compress.cache-dir          = "/var/cache/lighttpd/compress/"
/etc/lighttpd/lighttpd.conf:compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )
/etc/lighttpd/lighttpd.conf:include_shell "/usr/share/lighttpd/create-mime.conf.pl"
/etc/lighttpd/lighttpd.conf:include "/etc/lighttpd/conf-enabled/*.conf"
/etc/lighttpd/lighttpd.conf:server.modules += (
/etc/lighttpd/lighttpd.conf:    "mod_compress",
/etc/lighttpd/lighttpd.conf:    "mod_dirlisting",
/etc/lighttpd/lighttpd.conf:    "mod_staticfile",
/etc/lighttpd/lighttpd.conf:)
/etc/lighttpd/conf-enabled/05-setenv.conf:server.modules                += ( "mod_setenv" )
/etc/lighttpd/conf-enabled/10-accesslog.conf:server.modules += ( "mod_accesslog" )
/etc/lighttpd/conf-enabled/10-accesslog.conf:accesslog.filename = "/var/log/lighttpd/access.log"
/etc/lighttpd/conf-enabled/10-fastcgi.conf:server.modules += ( "mod_fastcgi" )
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:server.errorlog := "/var/log/lighttpd/error-pihole.log"
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:$HTTP["url"] =~ "^/admin/" {
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    server.document-root = "/var/www/html"
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    server.stream-response-body = 1
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    accesslog.filename = "/var/log/lighttpd/access-pihole.log"
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    accesslog.format = "%{%s}t|%h|%V|%r|%s|%b"
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    fastcgi.server = (
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        ".php" => (
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:            "localhost" => (
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                "socket" => "/run/lighttpd/pihole-php-fastcgi.socket",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                "bin-path" => "/usr/bin/php-cgi",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                "min-procs" => 1,
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                "max-procs" => 1,
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                "bin-environment" => (
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                    "PHP_FCGI_CHILDREN" => "4",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                    "PHP_FCGI_MAX_REQUESTS" => "10000",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                ),
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                "bin-copy-environment" => (
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                    "PATH", "SHELL", "USER"
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                ),
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:                "broken-scriptfilename" => "enable",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:            )
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        )
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    )
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    setenv.add-response-header = (
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        "X-Pi-hole" => "The Pi-hole Web interface is working!",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        "X-Frame-Options" => "DENY",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        "X-XSS-Protection" => "0",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        "X-Content-Type-Options" => "nosniff",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        "Content-Security-Policy" => "default-src 'self' 'unsafe-inline';",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        "X-Permitted-Cross-Domain-Policies" => "none",
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        "Referrer-Policy" => "same-origin"
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    )
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    $HTTP["url"] =~ "^/admin/\." {
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        url.access-deny = ("")
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    }
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    $HTTP["url"] =~ "/(teleporter|api_token)\.php$" {
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        $HTTP["referer"] =~ "/admin/settings\.php" {
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:            setenv.set-response-header = ( "X-Frame-Options" => "SAMEORIGIN" )
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        }
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    }
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:}
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:else $HTTP["url"] == "/admin" {
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    url.redirect = ("" => "/admin/")
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:}
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:$HTTP["host"] == "pi.hole" {
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    $HTTP["url"] == "/" {
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:        url.redirect = ("" => "/admin/")
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:    }
/etc/lighttpd/conf-enabled/15-pihole-admin.conf:}
/etc/lighttpd/conf-enabled/99-unconfigured.conf:index-file.names := ( "index.php", "index.html", "index.lighttpd.html" )
pi@bpi-m2z:~$
pi@bpi-m2z:~$ sudo lighttpd -v
lighttpd/1.4.55 (ssl) - a light and fast webserver
pi@bpi-m2z:~$


Looks like there is something removing the directory every time you reboot.

Did you mount /run on a temp filesystem?

You are probably right. Here:

pi@bpi-m2z:~$ mount
/dev/mmcblk0p2 on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600,stripe=1024)
devtmpfs on /dev type devtmpfs (rw,relatime,size=235848k,nr_inodes=58962,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=50648k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/mmcblk0p1 on /boot type ext4 (rw,relatime,stripe=1024)
tmpfs on /run/user/1001 type tmpfs (rw,nosuid,nodev,relatime,size=50644k,mode=700,uid=1001,gid=1001)
pi@bpi-m2z:~$ 

Also:

pi@bpi-m2z:~$ df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  985M   13G   8% /
devtmpfs        231M     0  231M   0% /dev
tmpfs           248M  1.9M  246M   1% /dev/shm
tmpfs            50M  4.2M   46M   9% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           248M     0  248M   0% /sys/fs/cgroup
/dev/mmcblk0p1   90M   13M   70M  16% /boot
tmpfs            50M     0   50M   0% /run/user/1001
pi@bpi-m2z:~$

I don't know why it's mounted that way, the Ubuntu image for bananapi zero is built by another github user here:
https://github.com/avafinger/bananapi-zero-ubuntu-base-minimal

How to make it permanent?

I don't use Ubuntu and I never did this before, but I think you can achieve the desired effect recreating the directory on lighttpd service start.

Try adding this code to lighttpd service file, if your OS uses systemd:

ExecStartPre=/bin/mkdir -p /run/lighttpd
ExecStartPre=/bin/chown www-data:www-data /run/lighttpd
2 Likes

Try Bananapi M2 Zero - Armbian

That has both Jammy and Bookworm. I'd suggest Bookworm, it's lighter and has no desktop environment.

The image you are using is very old. (In terms of OS releases.) Doesn't seem to be getting any updates.

Thanks! The thing is that those latest Armbian images have by default USB OTG disabled and ETH0 is also disabled. So they are basically useless, since you can't use a keyboard to configure further, nor connect via SSH...
That's why I searched for an alternative.

I have never seen that on any of the Armbian installs I've done. I run that distro on my SBCs.

How to boot?(Getting Started - Armbian Documentation)

Insert SD card into a slot and power the board. (First) boot (with DHCP) takes up to two minutes with a class 10 SD card and cheapest board.

How to login?(Getting Started - Armbian Documentation)

First boot will log you automatically on HDMI or serial console while for SSH login you need to login as root and use password 1234. You will be prompted to change this password. You will then be asked to create a normal user account that is sudo enabled (beware of default QWERTY keyboard settings at this stage). Please use this tool, to find your board IP address.

Ok, but I'm telling you what I see from 2 days of testing a ton of different images for this bananapi zero board. The USB OTG is disabled by default and ethernet driver is not included in those... (Maybe because there's no ethernet connector on the board, only 4 pins to solder cable for 100Mbit connection).
If you have this board, please try it.

EDIT2: See reply from me below first!

It appears that the issue is the missing /run/lighttpd folder at boot.

If above doesnt solve, you could try change the path for the PHP socket.
I still have an older lighttpd:

pi@ph5a:~ $ apt policy lighttpd
lighttpd:
  Installed: 1.4.53-4+deb10u2
pi@ph5a:~ $ sudo lighttpd -v
lighttpd/1.4.53 (ssl) - a light and fast webserver

With a different path for the PHP socket (not on a tmpfs mount in RAM):

pi@ph5a:~ $ sudo /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p
[..]
    fastcgi.server                 = (
        ".php" => (
            (
                "bin-path"              => "/usr/bin/php-cgi",
                "socket"                => "/var/run/lighttpd/php.socket",
                "max-procs"             => 1,
                "bin-environment"       => (
                    "PHP_FCGI_CHILDREN"     => "4",
                    "PHP_FCGI_MAX_REQUESTS" => "10000",
                    # 2
                ),
                "bin-copy-environment"  => ("PATH", "SHELL", "USER"),
                # 5
                "broken-scriptfilename" => "enable",
                # 6
            ),
        ),
    )

Could try edit below file and change that line with the "socket" path to resemble mine?

sudo nano /etc/lighttpd/conf-enabled/15-pihole-admin.conf

And create that folder if doesnt exist:

sudo mkdir /var/run/lighttpd

sudo chown www-data: /var/run/lighttpd

sudo chmod 750 /var/run/lighttpd

Restart:

sudo systemctl restart lighttpd.service

And check status and journals:

sudo systemctl status lighttpd.service

journalctl --full --no-pager -u lighttpd.service --lines 15

EDIT: And oc reboot :wink:

Oh blast, I noticed I included your last edit (with the changed socket path) after typing up my reply :smiley:
Our replies/edits must have crossed.

@toto99303 , run below one and try adding above to the systemd unit file?

sudo systemctl edit --full lighttpd.service

Or if you get an empty file to edit (mine did):

sudo nano /lib/systemd/system/lighttpd.service

sudo systemctl daemon-reload

EDIT: Added the --full argument for the edit.
That will do the trick if get an empty edit or an overide.conf unit.

You can simplify those three lines to a single one with below:

ExecStartPre=/usr/bin/install -d /run/lighttpd -o www-data -g www-data -m 750

So it should look similar to below:

pi@ph5a:~ $ sudo systemctl edit --full lighttpd.service
[Unit]
Description=Lighttpd Daemon
After=network-online.target

[Service]
Type=simple
PIDFile=/run/lighttpd.pid
ExecStartPre=/usr/bin/install -d /run/lighttpd -o www-data -g www-data -m 750
ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
ExecReload=/bin/kill -USR1 $MAINPID
Restart=on-failure

[Install]
WantedBy=multi-user.target

The install command should be installed for most distros:

pi@ph5a:~ $ dpkg -S /usr/bin/install
coreutils: /usr/bin/install

Thanks to all who tried to help and spared time!
Unfortunately I was not able to fix this and reverted to Armbian.
Also, to anyone trying to use the integrated eth0 interface - beware it's not stable and dropping. Stay away from this configuration.

Please close the case.

1 Like

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