GNU bug report logs - #49056
[PATCH] services: pcscd: Fix daemon signal handling.

Previous Next

Package: guix-patches;

Reported by: Brice Waegeneire <brice <at> waegenei.re>

Date: Wed, 16 Jun 2021 06:39:02 UTC

Severity: normal

Tags: patch

Done: Brice Waegeneire <brice <at> waegenei.re>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49056 in the body.
You can then email your comments to 49056 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49056; Package guix-patches. (Wed, 16 Jun 2021 06:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brice Waegeneire <brice <at> waegenei.re>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 16 Jun 2021 06:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: pcscd: Fix daemon signal handling.
Date: Wed, 16 Jun 2021 08:38:18 +0200
"pcscd" wouldn't handle SIGTERM as it inherited ignoring this
signal (and others) from its parent shepherd.  The constructor
make-forkexec, restore signal handling.  Fixes
<https://issues.guix.gnu.org/45202>.

* gnu/services/security-token.scm (pcscd)[start]: Use
make-fork-exec-constructor to start "pcscd".
---
Depend on patch <https://issues.guix.gnu.org/48987>.

 gnu/services/security-token.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gnu/services/security-token.scm b/gnu/services/security-token.scm
index 0cbb591e10..822984b70b 100644
--- a/gnu/services/security-token.scm
+++ b/gnu/services/security-token.scm
@@ -57,12 +57,15 @@
         (provision '(pcscd))
         (requirement '(syslogd))
         (modules '((gnu build shepherd)))
-        (start #~(lambda _
+        (start #~(lambda args
                    (let ((socket "/run/pcscd/pcscd.comm"))
                      (when (file-exists? socket)
                        (delete-file socket)))
-                   (invoke #$(file-append pcsc-lite "/sbin/pcscd"))
-                   (call-with-input-file "/run/pcscd/pcscd.pid" read)))
+                   (apply (make-forkexec-constructor
+                           (list #$(file-append pcsc-lite "/sbin/pcscd")
+                                 "--foreground")
+                           #:log-file "/var/log/pcscd.log")
+                          args)))
         (stop #~(make-kill-destructor)))))))
 
 (define pcscd-activation
-- 
2.31.1





Information forwarded to guix-patches <at> gnu.org:
bug#49056; Package guix-patches. (Sat, 26 Jun 2021 21:01:01 GMT) Full text and rfc822 format available.

Message #8 received at 49056 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 49056 <at> debbugs.gnu.org
Subject: Re: bug#49056: [PATCH] services: pcscd: Fix daemon signal handling.
Date: Sat, 26 Jun 2021 22:59:53 +0200
Hi,

Brice Waegeneire <brice <at> waegenei.re> skribis:

> "pcscd" wouldn't handle SIGTERM as it inherited ignoring this
> signal (and others) from its parent shepherd.  The constructor
> make-forkexec, restore signal handling.  Fixes
> <https://issues.guix.gnu.org/45202>.
>
> * gnu/services/security-token.scm (pcscd)[start]: Use
> make-fork-exec-constructor to start "pcscd".

Well done!

> +        (start #~(lambda args
>                     (let ((socket "/run/pcscd/pcscd.comm"))
>                       (when (file-exists? socket)
>                         (delete-file socket)))
> -                   (invoke #$(file-append pcsc-lite "/sbin/pcscd"))
> -                   (call-with-input-file "/run/pcscd/pcscd.pid" read)))
> +                   (apply (make-forkexec-constructor
> +                           (list #$(file-append pcsc-lite "/sbin/pcscd")
> +                                 "--foreground")
> +                           #:log-file "/var/log/pcscd.log")
> +                          args)))

We can probably call ‘fork+exec-command’ directly instead of going
through ‘make-forkexec-constructor’, no?

Otherwise LGTM, thanks!

Ludo’.




Reply sent to Brice Waegeneire <brice <at> waegenei.re>:
You have taken responsibility. (Sat, 03 Jul 2021 18:19:01 GMT) Full text and rfc822 format available.

Notification sent to Brice Waegeneire <brice <at> waegenei.re>:
bug acknowledged by developer. (Sat, 03 Jul 2021 18:19:01 GMT) Full text and rfc822 format available.

Message #13 received at 49056-done <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 49056-done <at> debbugs.gnu.org
Subject: Re: bug#49056: [PATCH] services: pcscd: Fix daemon signal handling.
Date: Sat, 03 Jul 2021 20:18:12 +0200
Ludovic Courtès <ludo <at> gnu.org> writes:

> We can probably call ‘fork+exec-command’ directly instead of going
> through ‘make-forkexec-constructor’, no?
>
> Otherwise LGTM, thanks!

Changed to use ‘fork+exec-command’ and pushed as
e789ce538ed848bacb8f4eb5742f78b965ccf57c.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 01 Aug 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.