2009-01-14 22:04:18 +01:00
|
|
|
#!/bin/sh
|
2021-02-06 03:06:46 +01:00
|
|
|
#@ /etc/rc.d/lighttpd: start/stop lighttpd daemon
|
2009-01-14 22:04:18 +01:00
|
|
|
|
2015-07-26 18:20:27 +02:00
|
|
|
SSD=/sbin/start-stop-daemon
|
|
|
|
PROG=/usr/sbin/lighttpd
|
2021-02-06 21:23:24 +01:00
|
|
|
PID=/run/lighttpd.pid
|
2021-02-06 03:06:46 +01:00
|
|
|
OPTS='-f /etc/lighttpd.conf'
|
2015-07-26 18:20:27 +02:00
|
|
|
|
2021-02-05 02:19:41 +01:00
|
|
|
case ${1} in
|
2009-01-14 22:04:18 +01:00
|
|
|
start)
|
2021-02-08 23:08:52 +01:00
|
|
|
exec ${SSD} --start --pidfile ${PID} --exec ${PROG} -- ${OPTS}
|
2021-02-06 03:06:46 +01:00
|
|
|
;;
|
2009-01-14 22:04:18 +01:00
|
|
|
stop)
|
2021-02-08 23:08:52 +01:00
|
|
|
exec ${SSD} --stop --remove-pidfile --retry 10 --pidfile ${PID}
|
2021-02-06 03:06:46 +01:00
|
|
|
;;
|
2009-01-14 22:04:18 +01:00
|
|
|
restart)
|
2021-02-06 03:06:46 +01:00
|
|
|
${0} stop
|
2021-02-08 23:08:52 +01:00
|
|
|
exec ${0} start
|
2021-02-06 03:06:46 +01:00
|
|
|
;;
|
2015-07-26 18:20:27 +02:00
|
|
|
status)
|
2021-02-06 03:06:46 +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
|
|
|
|
exit ${e}
|
|
|
|
;;
|
2009-01-14 22:04:18 +01:00
|
|
|
*)
|
2021-02-06 03:06:46 +01:00
|
|
|
echo "usage: ${0} [start|stop|restart|status]"
|
|
|
|
;;
|
2009-01-14 22:04:18 +01:00
|
|
|
esac
|
|
|
|
|
2021-02-06 03:06:46 +01:00
|
|
|
# s-sh-mode
|