hello,

There's an effort in Fedora to improve all our init scripts
for better LSB compliance. Because I'm responsible for mailman
package here, I made following changes in the mailman init scripts:

* when mailman is unconfigured, `service mailman start' should exit with code
6, not 1.

* `try-restart' was't implemented. This is an addition to condrestart and
should have the same effect.

* stopping mailman when already stopped doesn't print scary error
  message now, prints "mailman already stopped" instead

* when /var/lock/subsys/mailman exists but mailman isn't running, and `service
mailman status' was executed, the script just printed 'mailman is stopped' and
exited with code 3. In this case, it should say that it's dead but its subsys is
locked, and exit with code 2.

* when no known parameter is passed to the init script, it should exit with
code 2, not 3.

patch attached, references:

http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/tocsysinit.html
(Linux Standard Base init scripts specification)

https://bugzilla.redhat.com/show_bug.cgi?id=524016
(Red Hat bugzilla entry addressing mailman init scripts)

best regards,

    Daniel Novotny, Red Hat inc.
diff -up mailman-2.1.12/misc/mailman.in.initcleanup mailman-2.1.12/misc/mailman.in
--- mailman-2.1.12/misc/mailman.in.initcleanup	2009-10-05 09:09:35.000000000 -0400
+++ mailman-2.1.12/misc/mailman.in	2009-10-05 17:53:56.000000000 -0400
@@ -91,6 +91,8 @@ function start()
     then
 	touch /var/lock/subsys/$prog
 	InstallCron
+    else
+        RETVAL=6	
     fi
     echo
     return $RETVAL
@@ -98,6 +100,8 @@ function start()
 
 function stop()
 {
+    if [ -f /var/lock/subsys/$prog ]
+    then
     echo -n $"Shutting down $prog: "
     mailman-update-cfg
     daemon $MAILMANCTL -q stop
@@ -108,6 +112,10 @@ function stop()
 	RemoveCron
     fi
     echo
+    else
+    echo $"$prog already stopped."
+    RETVAL=0
+    fi
     return $RETVAL
 }
 
@@ -135,7 +143,7 @@ case "$1" in
     RETVAL=$?
     ;;
 
-'condrestart')
+'condrestart'|'try-restart')
     $MAILMANCTL -q -u status
     retval=$?
     if [ $retval -eq 0 ]
@@ -146,13 +154,20 @@ case "$1" in
     ;;
 
 'status')
-    $MAILMANCTL -u status
+    output=$($MAILMANCTL -u status)
     RETVAL=$?
+    if [ $RETVAL -eq 3 -a -f /var/lock/subsys/$prog ]
+    then
+        echo $"$prog dead but subsys locked"
+        RETVAL=2
+    else
+        echo $output
+    fi
     ;;
 
 *)
-    echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|status}"
-    RETVAL=3
+    echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|try-restart|status}"
+    RETVAL=2
     ;;
 
 esac
_______________________________________________
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9

Reply via email to