configtest() {
/usr/sbin/httpd.${HTTPD_MPM} -t $CFG $HTTPD_OPTS >/dev/null 2>&1
+ RETVAL=$?
}
start() {
reload|force-reload|graceful)
if [ -f /var/lock/subsys/httpd ]; then
configtest
- RETVAL=$?
if [ $RETVAL -eq 0 ]; then
msg_reloading httpd.${HTTPD_MPM}
busy
msg_reloading httpd.${HTTPD_MPM}
configtest
- RETVAL=$?
if [ $RETVAL -eq 0 ]; then
/usr/sbin/httpd.${HTTPD_MPM} $CFG -k graceful
RETVAL=$?
[ $RETVAL -eq 0 ] && ok || fail
else
fail
- echo >&2 "Configuration file syntax test failed."
+ echo >&2 "Configuration file syntax test failed. Run $0 configtest to see errors."
fi
fi
;;
start
else
fail
- echo >&2 "Configuration file syntax test failed."
+ echo >&2 "Configuration file syntax test failed. Run $0 configtest to see errors."
fi
}
reload() {
- sig=${1:-HUP}
- retnr=${2:-7}
+ local sig=${1:-HUP}
+ local retnr=${2:-7}
if [ -f /var/lock/subsys/apache ]; then
msg_reloading apache
RETVAL=$?
else
fail
- echo >&2 "Configuration file syntax test failed."
+ echo >&2 "Configuration file syntax test failed. Run $0 configtest to see errors."
fi
else
msg_not_running apache
stop)
stop
;;
- status)
- status apache
- RETVAL=$?
- /usr/sbin/apache -S
- ;;
restart)
restart
;;
configtest)
/usr/sbin/apache -t
;;
+ status)
+ status apache
+ RETVAL=$?
+ /usr/sbin/apache -S
+ ;;
*)
msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|graceful|configtest|status}"
exit 3