contrib/lighttpd/lighttpd.rc

38 lines
852 B
Plaintext
Raw Normal View History

2009-01-14 22:04:18 +01:00
#!/bin/sh
#
# /etc/rc.d/lighttpd: start/stop lighttpd daemon
#
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/lighttpd
PID=/var/run/lighttpd.pid
2021-02-05 02:19:41 +01:00
OPTS="-f /etc/lighttpd/lighttpd.conf"
2021-02-05 02:19:41 +01:00
case ${1} in
2009-01-14 22:04:18 +01:00
start)
2021-02-05 02:19:41 +01:00
${SSD} --start --pidfile ${PID} --exec ${PROG} -- ${OPTS}
;;
2009-01-14 22:04:18 +01:00
stop)
2021-02-05 02:19:41 +01:00
${SSD} --stop --remove-pidfile --retry 10 --pidfile ${PID}
;;
2009-01-14 22:04:18 +01:00
restart)
2021-02-05 02:19:41 +01:00
${0} stop
${0} start
;;
status)
2021-02-05 02:19:41 +01:00
${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
;;
2009-01-14 22:04:18 +01:00
*)
2021-02-05 02:19:41 +01:00
echo "usage: ${0} [start|stop|restart|status]"
;;
2009-01-14 22:04:18 +01:00
esac
# End of file