contrib/lighttpd/lighttpd.rc

37 lines
775 B
Plaintext
Raw Normal View History

2009-01-14 22:04:18 +01:00
#!/bin/sh
#@ /etc/rc.d/lighttpd: start/stop lighttpd daemon
2009-01-14 22:04:18 +01:00
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/lighttpd
PID=/run/lighttpd.pid
OPTS='-f /etc/lighttpd.conf'
2021-02-05 02:19:41 +01:00
case ${1} in
2009-01-14 22:04:18 +01:00
start)
exec ${SSD} --start --pidfile ${PID} --exec ${PROG} -- ${OPTS}
;;
2009-01-14 22:04:18 +01:00
stop)
exec ${SSD} --stop --remove-pidfile --retry 10 --pidfile ${PID}
;;
2009-01-14 22:04:18 +01:00
restart)
${0} stop
exec ${0} start
;;
status)
${SSD} --status --pidfile ${PID}
e=${?}
case ${e} in
0) echo "${PROG} is running with pid $(cat ${PID})";;
1) echo "${PROG} is not running but the pid file ${PID} exists";;
3) echo "${PROG} is not running";;
4) echo "Unable to determine the program status";;
esac
exit ${e}
;;
2009-01-14 22:04:18 +01:00
*)
echo "usage: ${0} [start|stop|restart|status]"
;;
2009-01-14 22:04:18 +01:00
esac
# s-sh-mode