areguera / rpms / mailman

Forked from rpms/mailman 5 years ago
Clone

Blame SOURCES/mailman-2.1.12-initcleanup.patch

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