Hi Simon,

Here is a shorter patch, that implements the pcscd restart in a
policy-compliant fashion.  This uses invoke-rc.d directly, without checking
if pcscd is already running.  This does carry the possibility that pcscd
will be started when it's not already running, but only in circumstances
that pcscd's own maintainer scripts would do the same: i.e., in a runlevel
where the service is configured to start but the admin has manually stopped
it and there is no policy-rc.d configured.

So there's no reason to take extra steps to check for the running process
beforehand, because 'restart' already does what's expected under policy.
(Note that, if the package supported 'reload' that would be sufficient; but
it doesn't, so 'force-reload' is equivalent to 'restart' *except* that
invoke-rc.d doesn't honor runlevel policies for 'force-reload'.)

As this patch fixes the bug and is a straightforward implementation of
policy, I'm going to go ahead shortly with an NMU to incoming.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
[EMAIL PROTECTED]                                   http://www.debian.org/
diff -u towitoko-2.0.7/debian/libtowitoko2.postinst towitoko-2.0.7/debian/libtowitoko2.postinst
--- towitoko-2.0.7/debian/libtowitoko2.postinst
+++ towitoko-2.0.7/debian/libtowitoko2.postinst
@@ -59,7 +59,7 @@
   db_stop
 
   if [ -x /etc/init.d/pcscd ]; then
-    /etc/init.d/pcscd restart-if-running 3>/dev/null
+    invoke-rc.d pcscd restart 3>/dev/null
   fi
 fi
 
diff -u towitoko-2.0.7/debian/libtowitoko2.postrm towitoko-2.0.7/debian/libtowitoko2.postrm
--- towitoko-2.0.7/debian/libtowitoko2.postrm
+++ towitoko-2.0.7/debian/libtowitoko2.postrm
@@ -23,7 +23,7 @@
     # restart pcscd (PCSC daemon) if the package is installed
     # and if pcscd is running
     if [ -x /etc/init.d/pcscd ]; then
-      /etc/init.d/pcscd restart-if-running 3>/dev/null || true
+      invoke-rc.d pcscd restart 3>/dev/null || true
     fi
 
     ;;
diff -u towitoko-2.0.7/debian/changelog towitoko-2.0.7/debian/changelog
--- towitoko-2.0.7/debian/changelog
+++ towitoko-2.0.7/debian/changelog
@@ -1,3 +1,13 @@
+towitoko (2.0.7-7.3) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * High-urgency upload for RC bugfix.
+  * Use invoke-rc.d and the standard 'restart' command for pcscd in
+    postinst/postrm, instead of calling the pcscd init script directly with
+    the no-longer-supported 'restart-if-running' command.  Closes: #407361.
+
+ -- Steve Langasek <[EMAIL PROTECTED]>  Sun, 11 Mar 2007 03:12:04 -0700
+
 towitoko (2.0.7-7.2) unstable; urgency=low
 
   * Non-maintainer upload to fix pending l10n issues.

Reply via email to