rc.lighttpd.redhat 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/sh
  2. #
  3. # lighttpd Startup script for the lighttpd server
  4. #
  5. # chkconfig: - 85 15
  6. # description: Lightning fast webserver with light system requirements
  7. #
  8. # processname: lighttpd
  9. # config: /etc/lighttpd/lighttpd.conf
  10. # config: /etc/sysconfig/lighttpd
  11. # pidfile: /var/run/lighttpd.pid
  12. #
  13. # Note: pidfile is assumed to be created
  14. # by lighttpd (config: server.pid-file).
  15. # If not, uncomment 'pidof' line.
  16. # Source function library
  17. . /etc/rc.d/init.d/functions
  18. if [ -f /etc/sysconfig/lighttpd ]; then
  19. . /etc/sysconfig/lighttpd
  20. fi
  21. if [ -z "$LIGHTTPD_CONF_PATH" ]; then
  22. LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf"
  23. fi
  24. prog="lighttpd"
  25. lighttpd="/usr/sbin/lighttpd"
  26. RETVAL=0
  27. start() {
  28. echo -n $"Starting $prog: "
  29. daemon $lighttpd -f $LIGHTTPD_CONF_PATH
  30. RETVAL=$?
  31. echo
  32. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
  33. return $RETVAL
  34. }
  35. stop() {
  36. echo -n $"Stopping $prog: "
  37. killproc $lighttpd
  38. RETVAL=$?
  39. echo
  40. [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
  41. return $RETVAL
  42. }
  43. reload() {
  44. echo -n $"Reloading $prog: "
  45. killproc $lighttpd -HUP
  46. RETVAL=$?
  47. echo
  48. return $RETVAL
  49. }
  50. case "$1" in
  51. start)
  52. start
  53. ;;
  54. stop)
  55. stop
  56. ;;
  57. restart)
  58. stop
  59. start
  60. ;;
  61. condrestart)
  62. if [ -f /var/lock/subsys/$prog ]; then
  63. stop
  64. start
  65. fi
  66. ;;
  67. reload)
  68. reload
  69. ;;
  70. status)
  71. status $lighttpd
  72. RETVAL=$?
  73. ;;
  74. *)
  75. echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
  76. RETVAL=1
  77. esac
  78. exit $RETVAL