Author: qboosh                       Date: Mon Nov 17 16:56:58 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fixed force-reload, added try-restart

---- Files affected:
SOURCES:
   pcsc-lite-pcscd.init (1.7 -> 1.8) 

---- Diffs:

================================================================
Index: SOURCES/pcsc-lite-pcscd.init
diff -u SOURCES/pcsc-lite-pcscd.init:1.7 SOURCES/pcsc-lite-pcscd.init:1.8
--- SOURCES/pcsc-lite-pcscd.init:1.7    Mon Mar  6 10:37:12 2006
+++ SOURCES/pcsc-lite-pcscd.init        Mon Nov 17 17:56:52 2008
@@ -32,11 +32,7 @@
        LOGOPT=""
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
-       # Check if the service is already running?
+start() {
        if [ ! -f /var/lock/subsys/pcscd ]; then
                msg_starting pcscd
                /usr/sbin/update-reader.conf && daemon pcscd $LOGOPT
@@ -45,9 +41,9 @@
        else
                msg_already_running pcscd
        fi
-       ;;
-  stop)
-       # Stop daemons.
+}
+
+stop() {
        if [ -f /var/lock/subsys/pcscd ]; then
                msg_stopping pcscd
                killproc pcscd
@@ -55,19 +51,44 @@
        else
                msg_not_running pcscd
        fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/pcscd ]; then
+               stop
+               start
+       else
+               msg_not_running pcscd
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
        ;;
-  restart|force-reload)
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
        # pcscd doesn't support reloading on HUP
-       $0 stop
-       $0 start
-       exit $?
+       condrestart 7
        ;;
   status)
        status pcscd
        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/pcsc-lite-pcscd.init?r1=1.7&r2=1.8&f=u

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

Reply via email to