summaryrefslogtreecommitdiff
path: root/debian/mini-httpd.init.d
diff options
context:
space:
mode:
Diffstat (limited to 'debian/mini-httpd.init.d')
-rw-r--r--debian/mini-httpd.init.d19
1 files changed, 18 insertions, 1 deletions
diff --git a/debian/mini-httpd.init.d b/debian/mini-httpd.init.d
index d1e4a3f..a852d83 100644
--- a/debian/mini-httpd.init.d
+++ b/debian/mini-httpd.init.d
@@ -33,12 +33,29 @@ case "$1" in
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
+ else
+ echo -e "You have to edit /etc/mini-httpd.conf and\n/etc/default/mini-httpd before running mini-httpd!"
+ exit 0
fi
;;
stop)
echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
+ # Get pid number
+ if [ -e /var/run/$NAME.pid ]
+ then
+ PID=`cat /var/run/$NAME.pid`
+ if [ -d /proc/$PID ]
+ then
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
+ else
+ # we need to remove the pidfile manually
+ if [ -e /var/run/$NAME.pid ]
+ then
+ rm -f /var/run/$NAME.pid
+ fi
+ fi
+ fi
echo "$NAME."
;;