[Pcsclite-muscle] need to restart pcscd for USB after boot

Ludovic Rousseau ludovic.rousseau at gmail.com
Wed Aug 16 09:05:57 PDT 2023


Le mer. 16 août 2023 à 16:45, Johannes Berg
<johannes at sipsolutions.net> a écrit :
> @Ludovic:
> > Without logs it is hard to know what is happening.
> > Have a look into /var/log/syslog or other files in /var/log/
>
> Right, but there aren't really any logs.
>
> # journalctl --system -b | grep pcscd
> Aug 16 08:25:02 machine systemd[1]: Listening on pcscd.socket - PC/SC Smart Card Daemon Activation Socket.
> Aug 16 08:25:10 machine systemd[1]: Started pcscd.service - PC/SC Smart Card Daemon.
> Aug 16 08:25:10 machine audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=pcscd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
> Aug 16 08:56:37 machine systemd[1]: Stopping pcscd.service - PC/SC Smart Card Daemon...
> Aug 16 08:56:37 machine systemd[1]: pcscd.service: Deactivated successfully.
> Aug 16 08:56:37 machine systemd[1]: Stopped pcscd.service - PC/SC Smart Card Daemon.
> Aug 16 08:56:37 machine audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=pcscd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
> Aug 16 08:56:37 machine systemd[1]: pcscd.service: Consumed 2.715s CPU time.
> Aug 16 08:56:37 machine systemd[1]: Started pcscd.service - PC/SC Smart Card Daemon.
> Aug 16 08:56:37 machine audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=pcscd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
> Aug 16 08:56:51 machine pcscd[6563]: 00000000 winscard.c:286:SCardConnect() Error Reader Exclusive
> Aug 16 08:56:51 machine pcscd[6563]: 00015974 winscard.c:286:SCardConnect() Error Reader Exclusive
> Aug 16 08:56:51 machine pcscd[6563]: 00017059 winscard.c:286:SCardConnect() Error Reader Exclusive
>
> That last error message repeats, but it continues working anyway. No
> messages between the start and stop.

"SCardConnect() Error Reader Exclusive" indicates that a program asked
for a exclusive access to the reader.
And another program tried to also use the same reader.
The second program will receive an error and will not be able to use the reader.

I would suggest to increase the log level of gpg and your other
applications that use the smart card reader.
I guess one of the application will complain.

> Which is kind of why I was wondering about how to enable the logging if
> I cannot run the --foreground listed on the website; maybe just add
> similar command line options to the systemd unit so it starts like that
> on boot?

You can use the --debug argument.
See "pcscd arguments" in
https://blog.apdu.fr/posts/2021/08/pcsc-lite-configuration-using/

Bye

-- 
 Dr. Ludovic Rousseau



More information about the pcsclite-muscle mailing list