Advertisement
febripratama

lighttpd

Sep 2nd, 2014
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  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: /webserver/lighttpd/etc/lighttpd.conf
  10. # config: /webserver/lighttpd/etc/sysconfig/lighttpd
  11. # pidfile: /webserver/lighttpd/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.  
  17. # Source function library
  18. . /etc/rc.d/init.d/functions
  19.  
  20. if [ -f /webserver/lighttpd/etc/sysconfig/lighttpd ]; then
  21. . /webserver/lighttpd/etc/sysconfig/lighttpd
  22. fi
  23.  
  24. if [ -z "$LIGHTTPD_CONF_PATH" ]; then
  25. LIGHTTPD_CONF_PATH="/webserver/lighttpd/etc/lighttpd.conf"
  26. fi
  27.  
  28. prog="lighttpd"
  29. lighttpd="/webserver/lighttpd/sbin/lighttpd"
  30. RETVAL=0
  31.  
  32. start() {
  33. echo -n $"Starting $prog: "
  34. daemon $lighttpd -f $LIGHTTPD_CONF_PATH
  35. RETVAL=$?
  36. echo
  37. [ $RETVAL -eq 0 ] && touch /webserver/lighttpd/var/lock/subsys/$prog
  38. return $RETVAL
  39. }
  40.  
  41. stop() {
  42. echo -n $"Stopping $prog: "
  43. killproc $lighttpd
  44. RETVAL=$?
  45. echo
  46. [ $RETVAL -eq 0 ] && rm -f /webserver/lighttpd/var/lock/subsys/$prog
  47. return $RETVAL
  48. }
  49.  
  50. reload() {
  51. echo -n $"Reloading $prog: "
  52. killproc $lighttpd -HUP
  53. RETVAL=$?
  54. echo
  55. return $RETVAL
  56. }
  57.  
  58. case "$1" in
  59. start)
  60. start
  61. ;;
  62. stop)
  63. stop
  64. ;;
  65. restart)
  66. stop
  67. start
  68. ;;
  69. condrestart)
  70. if [ -f /webserver/lighttpd/var/lock/subsys/$prog ]; then
  71. stop
  72. start
  73. fi
  74. ;;
  75. reload)
  76. reload
  77. ;;
  78. status)
  79. status $lighttpd
  80. RETVAL=$?
  81. ;;
  82. *)
  83. echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
  84. RETVAL=1
  85. esac
  86.  
  87. exit $RETVAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement