services: pcscd: Fix daemon signal handling.

"pcscd" wouldn't handle SIGTERM as it inherit ignoring this signal (and
others) from its parent shepherd; fork+exec-command restore signal
handling.  Fixes <https://issues.guix.gnu.org/45202>.

* gnu/services/security-token.scm (pcscd)[start]: Use
fork+exec-command to start "pcscd".
This commit is contained in:
Brice Waegeneire 2021-06-15 23:24:30 +02:00
parent 9c1720591c
commit e789ce538e
No known key found for this signature in database
GPG key ID: A94903A166A18FAE

View file

@ -61,8 +61,10 @@ (define pcscd-shepherd-service
(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)))
(fork+exec-command
(list #$(file-append pcsc-lite "/sbin/pcscd")
"--foreground")
#:log-file "/var/log/pcscd.log")))
(stop #~(make-kill-destructor)))))))
(define pcscd-activation