severity 854703 normal
thank

On Thu, 09 Feb 2017 11:49:56 -0500 Antoine Beaupre <anar...@debian.org> wrote:
Package: pcscd
Version: 1.8.20-1
Severity: grave

Since I upgraded from 1.8.19-1 to 1.8.20-1 (or maybe it is because of
scdaemon 2.1.18, unclear), I cannot reliably use pcscd for multiple
days.

After a while, the pcscd daemon just disappears, and then scdaemon
cannot talk to it anymore:

fév 09 11:37:57 curie gpg-agent[23116]: scdaemon[32496] pcsc_establish_context 
failed: no service (0x8010001d)

This was partly documented in #854005 (GnuPG bug) and #854616
(scdaemon bug) which both have workarounds, and I was able to finally
use my yubikey *without* pcscd. But I believe there is a
pcscd-specific bug here that makes it basically unusable (hence the
grave severity).

Thanks for the 2 other bug numbers.

You are the first one to report such a problem.
I set the severity to normal.

$ systemctl --system status pcscd
● pcscd.service - PC/SC Smart Card Daemon
   Loaded: loaded (/etc/systemd/system/pcscd.service; indirect; vendor preset: 
enabled)
   Active: inactive (dead) since Wed 2017-02-08 21:37:16 EST; 14h ago
  Process: 15485 ExecStart=/usr/sbin/pcscd --foreground --auto-exit --debug 
(code=exited, status=0/SUCCESS)
 Main PID: 15485 (code=exited, status=0/SUCCESS)

As you may have noticed, I have modified the .service file to enable
debugging:

[Unit]
Description=PC/SC Smart Card Daemon
Requires=pcscd.socket

[Service]
ExecStart=/usr/sbin/pcscd --foreground --auto-exit --debug
ExecReload=/usr/sbin/pcscd --hotplug

[Install]
Also=pcscd.socket

After that, I  have noticed that pcscd gladly commits suicide:

fév 08 21:37:15 curie pcscd[15485]: 00000023 pcscdaemon.c:225:signal_thread() 
Preparing for suicide

This is expected.
pcscd is started automatically by systemd when needed.
See "pcscd auto start using systemd" 
https://ludovicrousseau.blogspot.fr/2011/11/pcscd-auto-start-using-systemd.html

That time is about the time I stopped working last night. I unplugged
my Yubikey and went to bed.

The workaround is, obviously, to restart pcscd:

sudo systemctl restart pcscd

I guess you broke/disabled the socket activation.

Use:
sudo systemctl stop pcscd.socket
sudo systemctl start pcscd.socket

It is unclear to me why this regression happened. The systemd files
haven't changed since 2011, so presumably the use of --auto-exit is
normal. Maybe something changed in the --auto-exit algorithm? Looking
upstream, I can't find anything specific.

Maybe scdaemon doesn't talk to the right socket anymore, or that
socket activation is failing somehow?

I don't know or use scdaemon.

Trying to access the same device (a smart card reader) from 2 processes is not 
a good idea.
I don't know why the GnuPG people have reinvented the wheel instead of using 
PC/SC. I think they thought it was safer to do it their way. And now we have 
problems...

The safest default configuration for scdaemon should be "disable-ccid" so it "Just 
works ™".
For users that _really_ know what they do they can use the scdaemon internal 
ccid driver.

Am I the only one seeing this behavior?

Yes, AFAIK.

It is not a pcsc-lite bug. So unless you prove otherwise I will just close it 
"soon".

Bye

--
Dr. Ludovic Rousseau

Reply via email to