]> git.pld-linux.org Git - packages/pcsc-lite.git/commitdiff
- fixed force-reload, added try-restart
authorJakub Bogusz <qboosh@pld-linux.org>
Mon, 17 Nov 2008 16:56:52 +0000 (16:56 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    pcsc-lite-pcscd.init -> 1.8

pcsc-lite-pcscd.init

index 2fb2009438b22684626638480c62c951b5decce4..de745f211c35253082f007c3241c54e0e4792330 100644 (file)
@@ -32,11 +32,7 @@ else
        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 @@ case "$1" in
        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 @@ case "$1" in
        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
 
This page took 0.322083 seconds and 4 git commands to generate.