httpd 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. #######################################################################
  3. # Begin /etc/init.d/httpd
  4. #
  5. # Description : Start Apache Web Server
  6. #
  7. # Author : DJ Lucas - dj@linuxfromscratch.org
  8. # Bruce Dubbs - bdubbs@linuxfromscratch.org
  9. #
  10. # Version : LFS 7.0
  11. #
  12. ########################################################################
  13. ### BEGIN INIT INFO
  14. # Provides: httpd
  15. # Required-Start: $syslog $local_fs $network
  16. # Should-Start: $remote_fs
  17. # Required-Stop: $network
  18. # Should-Stop: $remote_fs
  19. # Default-Start: 3 4 5
  20. # Default-Stop: 0 1 2 6
  21. # Short-Description: Apache HTTP Server
  22. # Description: Controls the Apache HTTP Daemon
  23. # X-LFS-Provided-By: BLFS / LFS 7.0
  24. ### END INIT INFO
  25. . /lib/lsb/init-functions
  26. #$LastChangedBy: krejzi $
  27. #$Date: 2013-01-26 22:28:34 -0600 (Sat, 26 Jan 2013) $
  28. case "$1" in
  29. start)
  30. log_info_msg "Starting Apache HTTP daemon..."
  31. mkdir -p /var/run/httpd
  32. start_daemon /usr/sbin/apachectl -k start
  33. evaluate_retval
  34. ;;
  35. stop)
  36. log_info_msg "Stopping Apache HTTP daemon..."
  37. start_daemon /usr/sbin/apachectl -k stop
  38. evaluate_retval
  39. ;;
  40. restart)
  41. log_info_msg "Restarting Apache HTTP daemon..."
  42. start_daemon /usr/sbin/apachectl -k restart
  43. evaluate_retval
  44. ;;
  45. status)
  46. statusproc /usr/sbin/httpd
  47. ;;
  48. *)
  49. echo "Usage: $0 {start|stop|restart|status}"
  50. exit 1
  51. ;;
  52. esac
  53. # End /etc/init.d/httpd