Author: qboosh                       Date: Wed Nov 28 19:09:25 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- force-reload is not supposed to start service if not running
- added try-restart action (LSB 3.1)

---- Files affected:
SOURCES:
   mdadm.init (1.8 -> 1.9) 

---- Diffs:

================================================================
Index: SOURCES/mdadm.init
diff -u SOURCES/mdadm.init:1.8 SOURCES/mdadm.init:1.9
--- SOURCES/mdadm.init:1.8      Wed Nov 28 18:27:12 2007
+++ SOURCES/mdadm.init  Wed Nov 28 20:09:20 2007
@@ -42,6 +42,18 @@
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/mdadm ]; then
+               stop
+               start
+       else
+               if [ $1 -ne 0 ]; then
+                       msg_not_running mdadm
+               fi
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -51,16 +63,22 @@
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        status mdadm
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/mdadm.init?r1=1.8&r2=1.9&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to