[pkg-opensc-commit] [SCM] OpenCT packaging branch, master, updated. 4fd021ac093fe3775160db2c9a5a3c0dba5cfc0e

Eric Dorland eric at debian.org
Mon Aug 11 02:32:09 UTC 2008


The following commit has been merged in the master branch:
commit 909b41e037e93fbdf5be2a2fddf71cc59a7b8792
Author: Eric Dorland <eric at debian.org>
Date:   Sun Aug 10 21:38:22 2008 -0400

    Make the stop action not fail if the service is already down.
    
    * etc/init-script.in: Make the stop action not fail if the service is
      already down. (Closes: #494385)

diff --git a/debian/changelog b/debian/changelog
index bdfd33c..5484e85 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ openct (0.6.14-3) unstable; urgency=low
   * debian/libopenct1.shlibs: Drop blank line that was causing
     warnings. (Closes: #454580)
   * debian/libopenct1.symbols: Add symbols file.
+  * etc/init-script.in: Make the stop action not fail if the service is
+    already down. (Closes: #494385)
 
  --
 
diff --git a/etc/init-script.in b/etc/init-script.in
index a6fc0dc..8db6fed 100644
--- a/etc/init-script.in
+++ b/etc/init-script.in
@@ -15,6 +15,8 @@
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=SBINDIR/openct-control
+STATUS_DIR=/var/run/openct
+STATUS_FILE="$STATUS_DIR/status"
 NAME=OpenCT
 DESC="smart card terminal framework"
 
@@ -22,16 +24,16 @@ test -x $DAEMON || exit 0
 
 # create the directory for our status and socket files,
 # if it does not exist.
-if ! test -e /var/run/openct
+if ! test -e $STATUS_DIR
 then
-	mkdir /var/run/openct
+	mkdir $STATUS_DIR
 
 	# maybe you also want to set owner ship and permissions here.
 	# this example would assign the directory to a group "scard"
 	# and set permissions so only users in that group can access
 	# smart card readers via openct.
-	chown root:scard /var/run/openct
-	chmod 0750 /var/run/openct
+	chown root:scard $STATUS_DIR
+	chmod 0750 $STATUS_DIR
 fi
 
 set -e
@@ -44,8 +46,10 @@ case "$1" in
 	;;
   stop)
 	echo -n "Stopping $DESC: $NAME "
-	$DAEMON shutdown
-	rm /var/run/openct/status
+	if [ -f $STATUS_FILE ]; then
+	        $DAEMON shutdown
+	        rm -f $STATUS_FILE
+        fi
 	echo "."
 	;;
   #reload)
@@ -68,9 +72,9 @@ case "$1" in
 	#	just the same as "restart".
 	#
 	echo -n "Restarting $DESC: $NAME"
-	if [ -f /var/run/openct/status ]; then
+	if [ -f $STATUS_FILE ]; then
 		$DAEMON shutdown
-		rm -f /var/run/openct/status
+		rm -f $STATUS_FILE
 	fi
 	sleep 0.1
 	$DAEMON init

-- 
OpenCT packaging



More information about the pkg-opensc-commit mailing list