-RETVAL=0
-# See how we were called.
-case "$1" in
- start)
- # Check if the service is already running?
- if [ ! -f /var/lock/subsys/httpd ]; then
- msg_starting httpd.${HTTPD_MPM}
- daemon httpd.${HTTPD_MPM} $CFG $HTTPD_OPTS
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/httpd
- else
- msg_already_running httpd.${HTTPD_MPM}
- fi
- ;;
- stop)
- # Stop daemons.
- if [ -f /var/lock/subsys/httpd ]; then
- msg_stopping httpd.${HTTPD_MPM}
- killproc --pidfile httpd.pid httpd.${HTTPD_MPM}
- rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* >/dev/null 2>&1
- else
- msg_not_running httpd.${HTTPD_MPM}
- fi
- ;;
- status)
- status httpd.${HTTPD_MPM}
- RETVAL=$?
- /usr/sbin/httpd.${HTTPD_MPM} $CFG -S
- ;;
- restart)
- $0 stop
- $0 start
- ;;
- reload|force-reload|graceful)
- if [ -f /var/lock/subsys/httpd ]; then
- run_cmd "Checking httpd.${HTTPD_MPM} configuration" httpd.${HTTPD_MPM} $CFG -t
+# configtest itself
+configtest() {
+ /usr/sbin/httpd -t $CFG $HTTPD_OPTS 2>&1
+ return $?
+}
+
+# wrapper for configtest:
+checkconfig() {
+ local details=${1:-0}
+
+ 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`