Debian lighttpd startup script


/ Published in: Bash
Save to your folder(s)

There is no debian startup script for the lighttpd webserver, if you install the server from sources. You could rewrite the redhat init script for your self, but i've already done this for you :-)


Copy this code and paste it in your HTML
  1. #! /bin/sh
  2. # Debian startup script for lighttpd webserver
  3. #
  4. # Author: Robert Eisele <[email protected]>
  5. # Source: http://www.xarg.org/dowload/rc.lighttpd.debian
  6. #
  7.  
  8. LIGHTTPD_BIN=/usr/local/sbin/lighttpd
  9. test -x $LIGHTTPD_BIN || exit 5
  10.  
  11. LIGHTTPD_CONFIG=/etc/lighttpd/lighttpd.conf
  12. test -r $LIGHTTPD_CONFIG || exit 6
  13.  
  14. LIGHTTPD_PIDFILE=/var/run/lighttpd.pid
  15. LIGHTTPD_LOGFILE=/var/log/lighttpd/access.log
  16.  
  17. case "$1" in
  18. start)
  19. echo "Starting lighttpd"
  20. $LIGHTTPD_BIN -f $LIGHTTPD_CONFIG
  21. ;;
  22.  
  23. stop)
  24. echo "Shutting down lighttpd"
  25. kill `cat $LIGHTTPD_PIDFILE`
  26. ;;
  27.  
  28. restart)
  29. $0 stop
  30. sleep 1
  31. $0 start
  32. ;;
  33.  
  34. force-reload|reload)
  35. echo "Reload service lighttpd"
  36. kill -INT `cat $LIGHTTPD_PIDFILE`
  37. $0 start
  38. touch $LIGHTTPD_PIDFILE
  39. ;;
  40.  
  41. rotate)
  42. echo "Rotate logfile of lighttpd"
  43. mv $LIGHTTPD_LOGFILE /tmp/`date +%D`.log
  44. kill -HUP `cat $LIGHTTPD_PIDFILE`
  45. ;;
  46.  
  47. *)
  48. echo "Usage: $0 {start|stop|restart|force-reload|reload|rotate}"
  49. exit 1
  50. ;;
  51. esac

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.