From: Elan Ruusamäe Date: Wed, 15 Oct 2008 12:48:51 +0000 (+0000) Subject: - unify apache initscripts X-Git-Tag: auto/th/apache-2_2_9-9~1 X-Git-Url: https://git.pld-linux.org/?p=packages%2Fapache.git;a=commitdiff_plain;h=8c053aec0c9edc90b199d0c6cf61de80ee8d38e5 - unify apache initscripts Changed files: apache.init -> 1.62 apache1.init -> 1.29 --- diff --git a/apache.init b/apache.init index 80cd971..169ec3f 100644 --- a/apache.init +++ b/apache.init @@ -41,6 +41,7 @@ fi configtest() { /usr/sbin/httpd.${HTTPD_MPM} -t $CFG $HTTPD_OPTS >/dev/null 2>&1 + RETVAL=$? } start() { @@ -100,7 +101,6 @@ case "$1" in reload|force-reload|graceful) if [ -f /var/lock/subsys/httpd ]; then configtest - RETVAL=$? if [ $RETVAL -eq 0 ]; then msg_reloading httpd.${HTTPD_MPM} busy @@ -118,14 +118,13 @@ case "$1" in 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 ;; diff --git a/apache1.init b/apache1.init index cdcfe01..5503f20 100644 --- a/apache1.init +++ b/apache1.init @@ -87,13 +87,13 @@ restart() { 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 @@ -103,7 +103,7 @@ reload() { 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 @@ -120,11 +120,6 @@ case "$1" in stop) stop ;; - status) - status apache - RETVAL=$? - /usr/sbin/apache -S - ;; restart) restart ;; @@ -147,6 +142,11 @@ case "$1" in 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