#!/bin/sh
# Begin /etc/init.d/httpd

### 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 Daemon
# Description:         Controls the Apache HTTP Daemon
# X-LFS-Provided-By:   BLFS
### END INIT INFO

. /lib/lsb/init-functions

MESSAGE="Apache HTTP Daemon"
BIN_FILE=/usr/sbin/httpd
CONFIG_FILE=/etc/apache/httpd.conf

# Make certain that the binary exists, and that the config file exists
chk_stat

case "$1" in

    start)
        start_daemon /usr/sbin/apachectl -k start > /dev/null
        evaluate_retval start
    ;;

    stop)
        start_daemon /usr/sbin/apachectl -k stop > /dev/null
        evaluate_retval stop
    ;;

    restart)
        start_daemon /usr/sbin/apachectl -k restart > /dev/null
        evaluate_retval restart
    ;;

    status)
        statusproc
        evaluate_retval generic
    ;;

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

esac

# End /etc/init.d/httpd

