#!/bin/sh
#######################################################################
# Begin /etc/init.d/httpd
#
# Description : Start Apache Web Server
#
# Author      : DJ Lucas - dj@linuxfromscratch.org
#               Bruce Dubbs - bdubbs@linuxfromscratch.org
#
# Version     : LFS 7.0
#
########################################################################

### BEGIN INIT INFO
# Provides:            httpd
# Required-Start:      $syslog $local_fs $network
# Should-Start:        $remote_fs
# Required-Stop:       $network
# Should-Stop:         $remote_fs
# Default-Start:       3 4 5
# Default-Stop:        0 1 2 6
# Short-Description:   Apache HTTP Server
# Description:         Controls the Apache HTTP Daemon
# X-LFS-Provided-By:   BLFS / LFS 7.0
### END INIT INFO

. /lib/lsb/init-functions

#$LastChangedBy: krejzi $
#$Date: 2013-01-26 22:28:34 -0600 (Sat, 26 Jan 2013) $

case "$1" in
   start)
      log_info_msg "Starting Apache HTTP daemon..."
      mkdir -p /var/run/httpd
      start_daemon /usr/sbin/apachectl -k start
      evaluate_retval
      ;;

   stop)
      log_info_msg "Stopping Apache HTTP daemon..."
      start_daemon /usr/sbin/apachectl -k stop
      evaluate_retval
      ;;

   restart)
      log_info_msg "Restarting Apache HTTP daemon..."
      start_daemon /usr/sbin/apachectl -k restart
      evaluate_retval
      ;;

   status)
      statusproc /usr/sbin/httpd
      ;;

   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End /etc/init.d/httpd