"reload" action breaks further actions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lighttpd (Debian) |
Fix Released
|
Unknown
|
|||
lighttpd (Ubuntu) |
Fix Released
|
High
|
Andreas Hasenack |
Bug Description
After you issue a "service lighttpd reload" (or call /etc/init.
Example:
root@xenial-
root@xenial-
PID TTY STAT TIME COMMAND
(...)
4361 ? Ss 0:00 /usr/sbin/lighttpd -D -f /etc/lighttpd/
So pid is 4361, and things are good. "status" is happy:
root@xenial-
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/
Active: active (running) since Thu 2017-10-05 20:08:43 UTC; 45s ago
Process: 4356 ExecStartPre=
Main PID: 4361 (lighttpd)
"restart" works and we get a new pid:
root@xenial-
root@xenial-
5281
root@xenial-
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/
Active: active (running) since Thu 2017-10-05 20:09:58 UTC; 6s ago
Process: 5276 ExecStartPre=
Main PID: 5281 (lighttpd)
Now let's "reload". The systemd job has no reload target, so the reload code from the sysv script is used:
root@xenial-
* Reloading web server configuration lighttpd
...done.
root@xenial-
5912
We got a new PID, because that reload is more like a restart. But now things are broken:
root@xenial-
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/
Active: inactive (dead) since Thu 2017-10-05 20:10:49 UTC; 1min 2s ago
Process: 5281 ExecStart=
Process: 5276 ExecStartPre=
Main PID: 5281 (code=exited, status=0/SUCCESS)
And "restart" fails as well, because it tries to kill the process it thinks should be there, fails, and also fails to start a new one up because the port is already in use:
root@xenial-
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/
Active: failed (Result: exit-code) since Thu 2017-10-05 20:12:07 UTC; 1s ago
Process: 6853 ExecStart=
Process: 6848 ExecStartPre=
Main PID: 6853 (code=exited, status=255)
Oct 05 20:12:07 xenial-
Oct 05 20:12:07 xenial-
Oct 05 20:12:07 xenial-
Oct 05 20:12:07 xenial-
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: lighttpd 1.4.35-4ubuntu2
ProcVersionSign
Uname: Linux 4.13.0-12-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.10
Architecture: amd64
Date: Thu Oct 5 20:06:12 2017
ProcEnviron:
TERM=screen
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: lighttpd
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in lighttpd (Ubuntu): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
status: | New → In Progress |
importance: | Undecided → High |
Changed in lighttpd (Debian): | |
status: | Unknown → New |
Changed in lighttpd (Debian): | |
status: | New → Fix Released |
Hello,
This patch for lighttpd.service file changes default signal systemd sends to lighttpd when stopping service. It also sets a 60 seconds timeout after that SIGKILL will be sent to lighttpd and it's children if they survive first SIGINT. This makes `systemctl force-reload lighttpd.service` do a graceful restart, so using /etc/init. d/lighttpd is not even needed.
It's also a good idea to remove "reload" action from /etc/init. d/lighttpd completely because it's not supposed to be there, lighttpd doesn't support it.