Package: pcscd
Version: 1.7.4-2
Severity: wishlist
Tags: patch

Attached is a patch that adds support for the "status" action to the
pcscd init script.

Note that I had to move around some code that creates the IPCDIR.  You
should do this anyway, because it seems not sensible to remove the
directory containing the PID file before executing, say, the stop
action.
diff -Nru pcsc-lite-1.7.4/debian/changelog pcsc-lite-1.7.4/debian/changelog
--- pcsc-lite-1.7.4/debian/changelog	2011-08-27 21:03:18.000000000 +0300
+++ pcsc-lite-1.7.4/debian/changelog	2011-10-03 06:32:47.000000000 +0300
@@ -1,3 +1,9 @@
+pcsc-lite (1.7.4-2.1) UNRELEASED; urgency=low
+
+  * Add support for "status" action to init script
+
+ -- Peter Eisentraut <pet...@debian.org>  Mon, 03 Oct 2011 06:32:25 +0300
+
 pcsc-lite (1.7.4-2) unstable; urgency=low
 
   * Fix "Please tighten the dependency to `libpcsclite1`" (Closes: #638329)
diff -Nru pcsc-lite-1.7.4/debian/pcscd.init pcsc-lite-1.7.4/debian/pcscd.init
--- pcsc-lite-1.7.4/debian/pcscd.init	2010-12-04 23:38:58.000000000 +0200
+++ pcsc-lite-1.7.4/debian/pcscd.init	2011-10-03 06:32:13.000000000 +0300
@@ -32,12 +32,6 @@
 # /etc/default/pcscd and add a line 
 # DAEMON_ARGS="--your-option"
 
-# create $IPCDIR with correct access rights
-rm -rf $IPCDIR
-mkdir $IPCDIR
-chgrp pcscd $IPCDIR
-chmod g+w $IPCDIR
-
 # DO NOT start the daemon on startup
 # comment the line to have the same behavior as in version < 1.6.0
 exit 0
@@ -68,6 +62,12 @@
 #
 do_start()
 {
+	# create $IPCDIR with correct access rights
+	rm -rf $IPCDIR
+	mkdir $IPCDIR
+	chgrp pcscd $IPCDIR
+	chmod g+w $IPCDIR
+
 	# Return
 	#   0 if daemon has been started
 	#   1 if daemon was already running
@@ -127,6 +127,9 @@
 		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 	esac
 	;;
+  status)
+	status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
+	;;
   #reload|force-reload)
 	#
 	# If do_reload() is not implemented then leave this commented out
@@ -160,7 +163,7 @@
 	;;
   *)
 	#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
-	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
 	exit 3
 	;;
 esac

Reply via email to