jhon987 Apprentice
Joined: 18 Nov 2013 Posts: 297
|
Posted: Mon Jul 19, 2021 11:16 am Post subject: lighttpd stop script fails for more than 1 process |
|
|
Hi,
I'm checking out lighttpd lately and I've encountered an issue I'm pretty sure someone here could easily help me solve:
So, when lighttpd is configured to use workers, e.g. Code: | server.max-worker = 1 |
then the start-stop-daemon fails to stop it:
Code: | # rc-service lighttpd stop
lighttpd | * Stopping lighttpd ...
lighttpd | * start-stop-daemon: 1 process refused to stop [ !! ]
lighttpd | * ERROR: lighttpd failed to stop
|
I assume that's because the /etc/init.d/lighttpd is looking for the PID:
Code: | stop() {
local rv=0
ebegin "Stopping lighttpd"
start-stop-daemon --stop --quiet --pidfile "${LIGHTTPD_PID}"
eend $?
} |
whereas, lighttpd is running different PIDs:
Code: | # ps -aux | grep lighttpd
lighttpd 31850 0.0 0.0 6668 2336 ? S 14:01 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
lighttpd 31851 0.0 0.0 6804 580 ? S 14:01 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf |
so, AFAIK, the /etc/conf.d directory could be used to add (edit?) some user scripts?
I think I should kill it with pkill -15 lighttpd through conf.d/lighttpd, but I'm not sure whether and how to do so exactly so that when I issue: rc-service lighttpd restart - then it would take my stop function instead of init.d one...
can anyone please suggest a method of doing that?
P.S. generally, according to lighttpd docs, one shouldn't even use workers, however, I found that when when lighttpd encounters a closed unix socket - if it has only one process then it would simply crash, yet if I use even at least one worker - then it seem that one process will crash while the other, apparently, will spawn another one instead of the one that died.
I prefer this behavior... |
|