Config Errors Not Exiting Correctly / Out-of-date Service File
Description:
Copy-pasted from the forum post I created leading up to the discovery of this "bug". Please see that thread for more information.
I had
server.kbytes-per-second= 700000
in the config file (/etc/lighttpd.conf
) that caused the following error:Started Lighttpd Web Server. 2024-01-07 17:07:49: (configfile-glue.c.229) unexpected type for key: server.kbytes-per-second 2 expected a short integer, range 0 ... 65535 lighttpd-angel.c.107: child (pid=1047) exited normally with exitcode: 255 lighttpd.service: Deactivated successfully.
This is all well and good except that because lighttpd didn't exit with a proper error, systemd didn't know lighttpd had failed. The reason this is a problem for me is I have systemd configured to send emails out when services failed. When this service ran a few weeks ago, it did not start, but it didn't indicate to systemd that it had failed, so I never knew about it until a subsequent service failed (an almost-unrelated SSL cert renewal service). To clarify:
lighttpd -tt -f /etc/lighttpd/lighttpd.conf
correctly produces the exit code (255)lighttpd -f /etc/lighttpd/lighttpd.conf
also correctly produces the exit code (as should be obvious)lighttpd-angel -f /etc/lighttpd/lighttpd.conf
does not produce the error code, it only warns about it in the terminal (lighttpd-angel.c.107: child (pid=562352) exited normally with exitcode: 255
)- The systemd service file for lighttpd runs lighttpd with the command
/usr/bin/lighttpd-angel -D -f /etc/lighttpd/lighttpd.conf
, hence no error returned back to systemd to indicate failure
With this information, user gstrauss from the lighttpd forums was able to determine that the service file provided for lighttpd on Arch is 8.5 years old, and the current one for lighttpd is a bit different. I tried to see if this new service file that gstrauss says comes with lighttpd by default was present on my Arch system anywhere but I was unable to locate it.
Either way, I believe updating the service file to match, or take inspiration from, the new one provided by lighttpd would correct the issue I mentioned above. Let me know if I missed anything!
Additional info:
ENV:
lighttpd 1.4.73-1
linux-zen 6.6.9.zen1-1
systemd 255.2-1
Steps to reproduce:
- Add
server.kbytes-per-second= 700000
to the lighttpd config file (at/etc/lighttpd.conf
) - Start lighttpd with systemd (via
systemctl start lighttpd
) - Notice that systemd does not report failure, only that the app exited
- Verify that systemd did not see the service fail (with
systemctl --failed
)