areguera / rpms / mailman

Forked from rpms/mailman 4 years ago
Clone
49da8b
diff -up mailman-2.1.12/misc/mailman.in.initcleanup mailman-2.1.12/misc/mailman.in
49da8b
--- mailman-2.1.12/misc/mailman.in.initcleanup	2009-10-05 09:09:35.000000000 -0400
49da8b
+++ mailman-2.1.12/misc/mailman.in	2009-10-05 17:53:56.000000000 -0400
49da8b
@@ -91,6 +91,8 @@ function start()
49da8b
     then
49da8b
 	touch /var/lock/subsys/$prog
49da8b
 	InstallCron
49da8b
+    else
49da8b
+        RETVAL=6	
49da8b
     fi
49da8b
     echo
49da8b
     return $RETVAL
49da8b
@@ -98,6 +100,8 @@ function start()
49da8b
 
49da8b
 function stop()
49da8b
 {
49da8b
+    if [ -f /var/lock/subsys/$prog ]
49da8b
+    then
49da8b
     echo -n $"Shutting down $prog: "
49da8b
     mailman-update-cfg
49da8b
     daemon $MAILMANCTL -q stop
49da8b
@@ -108,6 +112,10 @@ function stop()
49da8b
 	RemoveCron
49da8b
     fi
49da8b
     echo
49da8b
+    else
49da8b
+    echo $"$prog already stopped."
49da8b
+    RETVAL=0
49da8b
+    fi
49da8b
     return $RETVAL
49da8b
 }
49da8b
 
49da8b
@@ -135,7 +143,7 @@ case "$1" in
49da8b
     RETVAL=$?
49da8b
     ;;
49da8b
 
49da8b
-'condrestart')
49da8b
+'condrestart'|'try-restart')
49da8b
     $MAILMANCTL -q -u status
49da8b
     retval=$?
49da8b
     if [ $retval -eq 0 ]
49da8b
@@ -146,13 +154,20 @@ case "$1" in
49da8b
     ;;
49da8b
 
49da8b
 'status')
49da8b
-    $MAILMANCTL -u status
49da8b
+    output=$($MAILMANCTL -u status)
49da8b
     RETVAL=$?
49da8b
+    if [ $RETVAL -eq 3 -a -f /var/lock/subsys/$prog ]
49da8b
+    then
49da8b
+        echo $"$prog dead but subsys locked"
49da8b
+        RETVAL=2
49da8b
+    else
49da8b
+        echo $output
49da8b
+    fi
49da8b
     ;;
49da8b
 
49da8b
 *)
49da8b
-    echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|status}"
49da8b
-    RETVAL=3
49da8b
+    echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|try-restart|status}"
49da8b
+    RETVAL=2
49da8b
     ;;
49da8b
 
49da8b
 esac