]> git.pld-linux.org Git - packages/apache.git/commitdiff
- use functions auto/ac/apache1-1_3_39-1 auto/ac/apache1-1_3_39-2 auto/ac/apache1-1_3_39-3 auto/th/apache1-1_3_37-10 auto/th/apache1-1_3_37-8 auto/th/apache1-1_3_37-9 auto/th/apache1-1_3_39-1 auto/th/apache1-1_3_39-2 auto/ti/apache1-1_3_39-2
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 25 Jan 2007 17:14:34 +0000 (17:14 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apache1.init -> 1.24

apache1.init

index ef23b7bf3751504731cd462ee189aeb6a250c363..1de6bf058bad2470f2469db938c1fe30bc600249 100644 (file)
@@ -33,10 +33,11 @@ if is_no "${IPV6_NETWORKING}"; then
        HTTPD_OPTS="$HTTPD_OPTS -4"
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+configtest() {
+       apache -t > /dev/null 2>&1
+}
+
+start() {
        # Check if the service is already running?
        if [ -x /usr/lib/apache1/lingerd ]; then
                if [ ! -f /var/lock/subsys/lingerd ]; then
@@ -56,8 +57,9 @@ case "$1" in
        else
                msg_already_running apache
        fi
-       ;;
-  stop)
+}
+
+stop() {
        # Stop daemons.
        if [ -f /var/lock/subsys/apache ]; then
                msg_stopping apache
@@ -75,6 +77,16 @@ case "$1" in
                        msg_not_running lingerd
                fi
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status apache
@@ -85,10 +97,8 @@ case "$1" in
        apache -t > /dev/null 2>&1
        RETVAL=$?
        if [ $RETVAL -eq 0 ]; then
-               $0 stop
-               RETVAL=$((RETVAL + $?))
-               $0 start
-               RETVAL=$((RETVAL + $?))
+               stop
+               start
        else
                fail
                echo "Configuration file syntax test failed."
@@ -99,7 +109,7 @@ case "$1" in
        if [ -f /var/lock/subsys/apache ]; then
                msg_reloading apache
 
-               apache -t > /dev/null 2>&1
+               configtest
                RETVAL=$?
                if [ $RETVAL -eq 0 ]; then
                        killproc apache -HUP
@@ -116,7 +126,7 @@ case "$1" in
        if [ -f /var/lock/subsys/apache ]; then
                msg_reloading apache
 
-               apache -t > /dev/null 2>&1
+               configtest
                RETVAL=$?
                if [ $RETVAL -eq 0 ]; then
                        killproc apache -USR1
@@ -133,7 +143,7 @@ case "$1" in
        if [ -f /var/lock/subsys/apache ]; then
                msg_reloading apache
 
-               apache -t > /dev/null 2>&1
+               configtest
                RETVAL=$?
                if [ $RETVAL -eq 0 ]; then
                        killproc apache -USR1
This page took 0.105614 seconds and 4 git commands to generate.