[pkg-lighttpd] Bug#877870: lighttpd: "reload" action breaks further actions
Andreas Hasenack
andreas at canonical.com
Fri Oct 6 13:53:02 UTC 2017
Package: lighttpd
Version: 1.4.45-1
Severity: normal
Dear Maintainer,
After you issue a "service lighttpd reload" (or call /etc/init.d/lighttpd
directly with the same action), all further actions stop working.
This happens because the "reload" action is not defined in the systemd
service file, so the code in /etc/init.d/lighttpd is used. That code in
turn restarts the service. When you later run status/stop/start/restart,
these are done via systemd and it thinks the service is dead because the
PID changed.
For example, starting with a running lighttpd:
root at sid-lighttpd-reload-1721635:~# ps fxaw
PID TTY STAT TIME COMMAND
(...)
17184 ? Ss 0:00 /usr/sbin/lighttpd -D -f
/etc/lighttpd/lighttpd.conf
root at sid-lighttpd-reload-1721635:~# service lighttpd status
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor
preset: enabled)
Active: active (running) since Fri 2017-10-06 13:48:53 UTC; 4s ago
(...)
Let's reload:
root at sid-lighttpd-reload-1721635:~# service lighttpd reload
[ ok ] Reloading web server configuration: lighttpd.
Status now is dead:
root at sid-lighttpd-reload-1721635:~# service lighttpd status
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor
preset: enabled)
Active: inactive (dead) since Fri 2017-10-06 13:49:08 UTC; 2s ago
Process: 17184 ExecStart=/usr/sbin/lighttpd -D -f
/etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Process: 17177 ExecStartPre=/usr/sbin/lighttpd -tt -f
/etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Main PID: 17184 (code=exited, status=0/SUCCESS)
But it's still running, albeit a new copy:
root at sid-lighttpd-reload-1721635:~# ps fxaw
PID TTY STAT TIME COMMAND
(...)
17231 ? S 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
"start" will fail now, for example:
root at sid-lighttpd-reload-1721635:~# service lighttpd status
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor
preset: enabled)
Active: failed (Result: exit-code) since Fri 2017-10-06 13:51:25 UTC;
836ms ago
Process: 17391 ExecStart=/usr/sbin/lighttpd -D -f
/etc/lighttpd/lighttpd.conf (code=exited, status=255)
Process: 17384 ExecStartPre=/usr/sbin/lighttpd -tt -f
/etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Main PID: 17391 (code=exited, status=255)
Oct 06 13:51:25 sid-lighttpd-reload-1721635 systemd[1]: lighttpd.service:
Unit entered failed state.
Oct 06 13:51:25 sid-lighttpd-reload-1721635 systemd[1]: lighttpd.service:
Failed with result 'exit-code'.
journalctl shows the reason:
Oct 06 13:51:24 sid-lighttpd-reload-1721635 lighttpd[17377]: 2017-10-06
13:51:24: (network.c.464) can't bind to port: 80 Address already in use
Managing this service via systemd or sysv is now effectively broken.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-lighttpd-maintainers/attachments/20171006/8ebb7c44/attachment.html>
More information about the pkg-lighttpd-maintainers
mailing list