#!/bin/sh # apache # Source functions library source /etc/rc.d/init.d/functions log_script_name "$0 $*" APACHECTL=/usr/sbin/apachectl # Check that the program is present and executable. if [ ! -x ${APACHECTL} ]; then log_message "*** ERROR: ${APACHECTL} program not found." exit ${EXIT_CODE_FAILURE} fi case "$1" in start) cmd_run_log_box "Starting Apache server" ${APACHECTL} -k start ;; stop) cmd_run_log_box "Stopping Apache server" ${APACHECTL} -k stop ;; restart) cmd_run_log_box "Re-starting Apache server" ${APACHECTL} -k restart ;; status) statusproc httpd ;; *) echo "Usage: $0 {start|stop|restart|status}" exit ${EXIT_CODE_FAILURE} ;; esac exit $?