Subject: bug#45202: closed (Re: bug#45202: pcscd service doesn't respond to SIGTERM)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 03 Jul 2021 18:26:02 +0000

Your bug report

#45202: pcscd service doesn't respond to SIGTERM

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
45202: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=45202
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#45202: pcscd service doesn't respond to SIGTERM
From: Brice Waegeneire <[email-masked]>
To: Raffael Stocker <[email-masked]>
Cc: Tobias Geerinckx-Rice <[email-masked]>, [email-masked]
Date: Sat, 03 Jul 2021 20:25:39 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello Raffael,

Raffael Stocker <[email-masked]> writes:

> Interesting indeed.  From looking at the source of pcsc-lite (main() in
> pcscdaemon.c) it seems it's not modifying its sigmask.  IIRC, child
> processes inherit the parent's ignored signals, so if shepherd is
> ignoring SIGTERM before a fork() and not resetting to default before an
> exec(), pcscd will never receive the SIGTERM.  This might explain the
> behaviour.  I have not checked shepherd's source to confirm.
>
> If this is so, it should probably be fixed in shepherd, right?

Thank yu for the analysis of the issue, it helped me a lot to fix it.
The sheperd pcscd serice wasn't using the correct procedure to start the
daemon, it is fixed in e789ce538ed848bacb8f4eb5742f78b965ccf57c.

Cheers,
- Brice

Subject: pcscd service (pcsc-lite) doesn't handle run directory properly
From: Raffael Stocker <[email-masked]>
To: [email-masked]
Date: Sat, 12 Dec 2020 15:31:22 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I use the pcsc-lite package and noticed that the pcscd service is
sometimes not started by shepherd/herd.  If it is started, "herd start
pcscd" gives me the following error message (sorry for the german part):

> herd: Ausnahmefehler während der Ausführung von »start« mit dem Dienst »pcscd«:
> In procedure open-file: No such file or directory: "/var/run/pcscd/pcscd.pid"

The reason seems to be that pcsc-lite creates its pid file in
"/run/pcscd/", but herd expects it in "/var/run/pcscd/".  This leads to
the service not being started when the files in "/run/pcscd/" have not
been cleaned up (or so my interpretation).  In this case, I get the
error message:

> herd: Ausnahmefehler während der Ausführung von »start« mit dem Dienst »pcscd«:
> Throw to key `%exception' with args `("#<&invoke-error program:
> \"/gnu/store/r1yd6czv3r0is0a1gfsrix3gslkba80v-pcsc-lite-1.9.0/sbin/pcscd\"
> arguments: () exit-status: 1 term-signal: #f stop-signal: #f>")'. 

If I delete the "/run/pcscd" directory, the daemon will be started,
although with the first error message from above.

I have been using guix for only a week now and don't know how to edit
service definitions etc., but maybe someone more competent could have a
look at this.

Regards,
Raffael