Commit 223acb15 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/lighttpd: save pidfile for lighttpd

Additionally change startup script to use start-stop-daemon
Note: start-stop-daemon does not create pid file
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 99cbeed5
......@@ -17,14 +17,26 @@ start_counter() {
start() {
echo -n "Starting lighttpd daemon: "
/usr/sbin/lighttpd -f /var/www/lighttpd.config
# note start-stop-daemon does not create pidfile, only check if pid is
# running
start-stop-daemon -q -p /var/run/lighttpd.pid -S \
--exec /usr/sbin/lighttpd -- -f /var/www/lighttpd.config
if [ $? -eq 0 ]; then
start_counter
echo "OK"
else
echo "Failed (already running?)"
fi
}
stop() {
echo -n "Stopping lighttpd daemon: "
killall lighttpd
start-stop-daemon -K -q -p /var/run/lighttpd.pid
if [ $? -eq 0 ]; then
start_counter
echo "OK"
else
echo "Failed"
fi
}
restart() {
stop
......
......@@ -126,4 +126,5 @@ fastcgi.server = ( ".php" => ((
## where to upload files to, purged daily.
server.upload-dirs = ( "/tmp" )
server.pid-file = "/var/run/lighttpd.pid"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment