rpms/openct/devel openct.init,1.6,1.7 openct.spec,1.42,1.43

Tomáš Mráz tmraz at fedoraproject.org
Wed May 19 14:42:54 UTC 2010


Author: tmraz

Update of /cvs/pkgs/rpms/openct/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv23883

Modified Files:
	openct.init openct.spec 
Log Message:
* Wed May 19 2010 Tomas Mraz <tmraz at redhat.com> - 0.6.19-3
- More init script fixes



Index: openct.init
===================================================================
RCS file: /cvs/pkgs/rpms/openct/devel/openct.init,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- openct.init	3 Feb 2010 20:09:42 -0000	1.6
+++ openct.init	19 May 2010 14:42:53 -0000	1.7
@@ -1,9 +1,10 @@
 #!/bin/sh
 #
-# openct       This shell script takes care of starting and stopping OpenCT.
+# openct       Script for starting and stopping OpenCT
 #
 # chkconfig:   2345 24 89
-# description: OpenCT is a middleware framework for smart card terminals.
+# description: OpenCT is a middleware framework for smart card terminals. \
+#              This script starts and stops the smart card terminal handlers.
 #
 # processname: ifdhandler
 # config:      /etc/openct.conf
@@ -15,13 +16,14 @@
 # Should-Start: $syslog $network
 # Should-Stop: $syslog $network
 # Short-Description: Middleware framework for smart card terminals
-# Description: This starts/stops the OpenCT middleware framework support
-#              for smart card terminals.
+# Description: OpenCT is a middleware framework for smart card terminals.
+#              This script starts and stops the smart card terminal handlers.
 ### END INIT INFO
 
 . /etc/rc.d/init.d/functions
 
 exec="/usr/sbin/openct-control"
+config="/etc/openct.conf"
 prog=openct
 proc=ifdhandler
 
@@ -31,22 +33,21 @@ OPENCT_OPTIONS=
 lockfile=/var/lock/subsys/$prog
 
 start() {
-    retval=0
-    if ! status $proc >/dev/null 2>&1 ; then
-        action $"Initializing OpenCT smart card terminals: " \
-            $exec $OPENCT_OPTIONS init
-        retval=$?
-        [ $retval -eq 0 ] && touch $lockfile
-    fi
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    action $"Initializing OpenCT smart card terminals: " \
+        $exec $OPENCT_OPTIONS init
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
     return $retval
 }
 
 stop() {
-    if status $proc >/dev/null 2>&1 ; then
-        action $"Stopping OpenCT smart card terminals: " \
+    action $"Stopping OpenCT smart card terminals: " \
             $exec $OPENCT_OPTIONS shutdown
-    fi
     retval=$?
+    echo
     if [ $retval -eq 0 ] ; then
         rm -f /var/run/openct/status
         rm -f $lockfile
@@ -59,8 +60,17 @@ restart() {
     start
 }
 
+oct_status_q() {
+    if ! $exec $OPENCT_OPTIONS status >/dev/null 2>&1; then
+        [ -f $lockfile ] && return 2
+        [ -f /var/run/openct/status ] && return 1
+        return 3
+    fi
+}
+
 oct_status() {
     status $proc
+    oct_status_q
     retval=$?
     if [ -e /var/run/openct/status ] ; then
         $exec $OPENCT_OPTIONS status
@@ -71,19 +81,33 @@ oct_status() {
 }
 
 case "$1" in
-    start|stop|restart)
+    start)
+        oct_status_q && exit 0
         $1
         ;;
-    reload|force-reload)
+    stop)
+        oct_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        oct_status_q || exit 7
+        restart
+        ;;
+    force_reload)
         restart
         ;;
     status)
         oct_status
         ;;
     try-restart|condrestart)
-  	[ ! -f $lockfile ] || restart
+        oct_status_q || exit 0
+        restart
 	;;
     *)
-        echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
+        echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart|reload|force-reload}"
         exit 2
 esac
+exit $?


Index: openct.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openct/devel/openct.spec,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -p -r1.42 -r1.43
--- openct.spec	3 Feb 2010 20:09:42 -0000	1.42
+++ openct.spec	19 May 2010 14:42:54 -0000	1.43
@@ -2,7 +2,7 @@
 
 Name:           openct
 Version:        0.6.19
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Middleware framework for smart card terminals
 
 Group:          System Environment/Libraries
@@ -179,6 +179,9 @@ fi
 
 
 %changelog
+* Wed May 19 2010 Tomas Mraz <tmraz at redhat.com> - 0.6.19-3
+- More init script fixes
+
 * Wed Feb  3 2010 Tomas Mraz <tmraz at redhat.com> - 0.6.19-2
 - Minor spec file and init script fixes (#561391)
 



More information about the scm-commits mailing list