lighttpd 799 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. #
  3. # /etc/rc.d/lighttpd: start/stop lighttpd daemon
  4. #
  5. SSD=/sbin/start-stop-daemon
  6. PROG=/usr/sbin/lighttpd
  7. PID=/var/run/lighttpd.pid
  8. OPTS="-f /etc/lighttpd.conf"
  9. case $1 in
  10. start)
  11. $SSD --start --pidfile $PID --exec $PROG -- $OPTS
  12. ;;
  13. stop)
  14. $SSD --stop --remove-pidfile --retry 10 --pidfile $PID
  15. ;;
  16. restart)
  17. $0 stop
  18. $0 start
  19. ;;
  20. status)
  21. $SSD --status --pidfile $PID
  22. case $? in
  23. 0) echo "$PROG is running with pid $(cat $PID)" ;;
  24. 1) echo "$PROG is not running but the pid file $PID exists" ;;
  25. 3) echo "$PROG is not running" ;;
  26. 4) echo "Unable to determine the program status" ;;
  27. esac
  28. ;;
  29. *)
  30. echo "usage: $0 [start|stop|restart|status]"
  31. ;;
  32. esac
  33. # End of file