Subject: [bug#49056] [PATCH] services: pcscd: Fix daemon signal handling.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 26 Jun 2021 22:59:53 +0200

Hi,

Brice Waegeneire <[email-masked]> 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’.