Commit 4f5ce6d4 authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: don't increase start counter when stopping lighttpd

Fix copy-paste error.
Distinguish between start-stop-daemon return value 0, 1 and the rest.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 1cfa8ba3
...@@ -21,23 +21,27 @@ start() { ...@@ -21,23 +21,27 @@ start() {
# running # running
start-stop-daemon -q -p /var/run/lighttpd.pid -S \ start-stop-daemon -q -p /var/run/lighttpd.pid -S \
--exec /usr/sbin/lighttpd -- -f /var/www/lighttpd.config --exec /usr/sbin/lighttpd -- -f /var/www/lighttpd.config
if [ $? -eq 0 ]; then ret=$?
if [ $ret -eq 0 ]; then
start_counter start_counter
echo "OK" echo "OK"
else elif [ $ret -eq 1 ]; then
echo "Failed (already running?)" echo "Failed (already running?)"
else
echo "Failed"
fi fi
} }
stop() { stop() {
echo -n "Stopping lighttpd daemon: " echo -n "Stopping lighttpd daemon: "
start-stop-daemon -K -q -p /var/run/lighttpd.pid start-stop-daemon -K -q -p /var/run/lighttpd.pid
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
start_counter
echo "OK" echo "OK"
else else
echo "Failed" echo "Failed"
fi fi
} }
restart() { restart() {
stop stop
start start
......
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