checkconfig() {
local details=${1:-0}
- if [ $details = 1 ]; then
+ if [ $details -eq 1 ]; then
# run config test and display report (status action)
show "Checking %s configuration" "$SVC_NAME"; busy
local out
out=`configtest 2>&1`
RETVAL=$?
- if [ $RETVAL = 0 ]; then
- ok
- else
- fail
- fi
+ [ $RETVAL -eq 0 ] && ok || fail
[ "$out" ] && echo >&2 "$out"
else
# run config test and abort with nice message if failed
# (for actions checking status before action).
+ show "Checking %s configuration" "$SVC_NAME"; busy
configtest >/dev/null 2>&1
RETVAL=$?
- if [ $RETVAL != 0 ]; then
- show "Checking %s configuration" "$SVC_NAME"; fail
+ if [ $RETVAL -eq 0 ]; then
+ ok
+ else
+ fail
nls 'Configuration test failed. See details with %s "checkconfig"' $0
exit $RETVAL
fi
return
fi
- checkconfig
+ [ "$1" -eq 0 ] || checkconfig
msg_starting "$SVC_NAME"
+ # remove ssl_scache on startup, otherwise httpd may go into
+ # infinite loop if there are db transaction logs laying around
+ rm -f /var/cache/httpd/*ssl_scache*
daemon --pidfile /var/run/httpd.pid /usr/sbin/httpd.${HTTPD_MPM} $CFG $HTTPD_OPTS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/httpd
stop
;;
restart)
+ checkconfig
stop
- start
+ start 0
;;
try-restart)
condrestart 0
;;
reload|force-reload|graceful|flush-logs)
- reload
+ reload
;;
checkconfig|configtest)
checkconfig 1