Bug 23926 - pcscd daemon does not run at startup
Summary: pcscd daemon does not run at startup
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords: 7beta1, NEEDINFO
Depends on:
Blocks:
 
Reported: 2018-11-30 17:03 CET by Herman Viaene
Modified: 2020-02-06 21:22 CET (History)
8 users (show)

See Also:
Source RPM: pcsc-lite-1.8.26-1.mga7.src.rpm
CVE:
Status comment:


Attachments

Description Herman Viaene 2018-11-30 17:03:20 CET
Description of problem:
pcscd daemon does not run after startup, Checking MCC - System - Services does not show pcscd at all.
Starting pcscd manually by "systemctl start pscsd", gets the pcscd running OK. Consulting thereafter MCC - System - Services shows pcscd in the list, status active and set to be activated at boot.
Rebooting the laptop brings the problem back alll over again.


Version-Release number of selected component (if applicable):


How reproducible:
every boot.


Steps to Reproduce:
1.
2.
3.
Comment 1 Sander Lepik 2018-11-30 21:18:50 CET
pcscd.service is actually not required to start. But what is the output of the following command:

systemctl status pcscd.socket

pcscd.socket should be active (running) this socket should start the pcscd.service when smart card is inserted.

CC: (none) => mageia

Comment 2 Herman Viaene 2018-12-01 12:37:33 CET
# systemctl -l status pcscd.socket
● pcscd.socket - PC/SC Smart Card Daemon Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/pcscd.socket; disabled; vendor prese>
   Active: inactive (dead)
   Listen: /run/pcscd.comm (Stream)
Comment 3 Sander Lepik 2018-12-01 14:26:06 CET
Hmm, did you install the system from Live media? I guess we've had problems with Live media not activating the socket.

During install it should run "systemctl enable pcscd.socket".
Comment 4 Herman Viaene 2018-12-01 14:55:26 CET
No, it is a classic installation.
Comment 5 Marja Van Waes 2018-12-02 15:59:04 CET
(In reply to Sander Lepik from comment #3)
> Hmm, did you install the system from Live media? I guess we've had problems
> with Live media not activating the socket.
> 
> During install it should run "systemctl enable pcscd.socket".

(In reply to Herman Viaene from comment #4)
> No, it is a classic installation.

I guess the classical iso should enable it, too?
report.bug.xz won't show a line about it, will it?

Herman, do you mind attaching /root/drakx/report.bug.xz anyway?

CC: (none) => isobuild, mageiatools, marja11
Keywords: (none) => 7beta1, NEEDINFO
Source RPM: (none) => drakx-installer-stage2? pcsc-lite?

Comment 6 Martin Whitaker 2018-12-02 18:12:56 CET
(In reply to Marja Van Waes from comment #5)
> (In reply to Sander Lepik from comment #3)
> > Hmm, did you install the system from Live media? I guess we've had problems
> > with Live media not activating the socket.
> > 
> > During install it should run "systemctl enable pcscd.socket".
> 
> (In reply to Herman Viaene from comment #4)
> > No, it is a classic installation.
> 
> I guess the classical iso should enable it, too?

See the thread starting at

  https://ml.mageia.org/l/arc/dev/2018-10/msg00367.html

If you want a service or socket to be enabled, you now need to explicitly whitelist it.

CC: (none) => mageia

Comment 7 Sander Lepik 2018-12-02 22:57:03 CET
(In reply to Martin Whitaker from comment #6)
> (In reply to Marja Van Waes from comment #5)
> > I guess the classical iso should enable it, too?
> 
> See the thread starting at
> 
>   https://ml.mageia.org/l/arc/dev/2018-10/msg00367.html
> 
> If you want a service or socket to be enabled, you now need to explicitly
> whitelist it.

PSCS is quite safe to enable by default. It doesn't open any ports and is really needed for those who use Smart Cards. I checked our systemd package but didn't find anything on how to whitelist some services - we don't do it yet?
Comment 8 Martin Whitaker 2018-12-02 23:01:50 CET
It's done in the mageia-release package - specifically in the 90-default.preset file.
Comment 9 Sander Lepik 2018-12-03 07:14:08 CET
That's interesting, pcscd.socket is already listed there...
Comment 10 Herman Viaene 2018-12-03 08:47:06 CET
@ Marja Comment 5
I don't mind, bur it'll have to wait till another iso comes around, as the one from Dec. on both my laptops (Intel graphics) the X-server seems to hang at startup.
And to the issue of the pcscd: 
Sander in Comment 1 wrote: "pcscd.socket should be active (running) this socket should start the pcscd.service when smart card is inserted."
Well, when I manually started the pcscd.socket and then inserted my eid card (smart card) the pcscd.service remained dead.
Comment 11 Marja Van Waes 2018-12-03 13:34:47 CET
(In reply to Herman Viaene from comment #10)

> And to the issue of the pcscd: 
> Sander in Comment 1 wrote: "pcscd.socket should be active (running) this
> socket should start the pcscd.service when smart card is inserted."
> Well, when I manually started the pcscd.socket and then inserted my eid card
> (smart card) the pcscd.service remained dead.

CC'ing AL13N, since he uses a Belgian eid card, too and because he intends to push updated beid-middleware to cauldron for bug 23925

CC: (none) => alien

Comment 12 Herman Viaene 2019-02-19 15:39:01 CET
Checked in M7beta2 i586:
After installation pcscd does not run, however now it is listed in MCC - System - Services now. So, that's half an improvement as far as I am concerned.
Comment 13 Herman Viaene 2019-02-19 16:02:33 CET
After rebooting, pcscd does not run, and it is marked in MCC - System - Services to run at startup.
checking:
# journalctl -b | grep pcsc
feb 19 15:42:37 mach6.hviaene.thuis drakxservices[3358]: running: /bin/systemctl --quiet is-enabled pcscd.service
feb 19 15:42:44 mach6.hviaene.thuis drakxservices[3358]: running: /bin/systemctl --quiet is-active pcscd.service
feb 19 15:43:03 mach6.hviaene.thuis drakxservices[3358]: running: /bin/systemctl --quiet is-enabled pcscd.service
Comment 14 Dave Hodgins 2019-02-19 16:33:45 CET
After installing pcsc-lite, running "systemctl enable pcscd.service" and then
rebooting ...
[root@x7v ~]# systemctl -a status pcscd.service
● pcscd.service - PC/SC Smart Card Daemon
   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; indirect; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:pcscd(8)
[root@x7v ~]# systemctl -a status pcscd.socket
● pcscd.socket - PC/SC Smart Card Daemon Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/pcscd.socket; enabled; vendor preset: enabled)
   Active: active (listening) since Tue 2019-02-19 10:28:36 EST; 50s ago
   Listen: /run/pcscd.comm (Stream)
   CGroup: /system.slice/pcscd.socket

Feb 19 10:28:36 x7v.hodgins.homeip.net systemd[1]: Listening on PC/SC Smart Card Daemon Activation Socket.

I don't have a pcsc card reader to test that it actually starts the service
when a card is inserted.

CC: (none) => davidwhodgins

Comment 15 Herman Viaene 2019-02-19 16:40:13 CET
@ Dave
In comment 13 the words "is-enabled pcscd.service" would lead me to believe that a manual intervention is not needed, am I right?
And secondly: do you really expect a normal user ("John Doe" in American speak) to have to do this sort of intervention. Anyway, I've never had to do this in M6 or previous.
Comment 16 Dave Hodgins 2019-02-19 16:57:36 CET
I only enabled the service and rebooted, which caused the socket to become
active.

After the reboot, even though the service is enabled, it auto-exits, so is
does not continue running, hence showing as dead.

Inserting the card after the service has been enabled, should start the
service actually running, as I understand it.

I think the vendor preset for the service needs to be changed to enabled,
rather then the socket.
Comment 17 Lewis Smith 2020-02-02 15:36:39 CET
Looking at old bugs...
@Herman : What is the state of play on this?

(In reply to Sander Lepik from comment #1)
> pcscd.service is actually not required to start.
> pcscd.socket should be active (running)
> this socket should start the pcscd.service when smart card is inserted.
The concluding questions seem to be:

1) Can you use this thing? Can you say what you had to do for it to work?

2) *Does the service start when a card is inserted*? See comments 1 & 16; your comment 13 was encouraging.
After startup, the output of:
 # systemctl -a status pcscd.service
 # systemctl -a status pcscd.socket
and after inserting a card:
 # systemctl -a status pcscd.service

Source RPM: drakx-installer-stage2? pcsc-lite? => pcsc-lite-1.8.26-1.mga7.src.rpm
CC: (none) => lewyssmith

Comment 18 papoteur 2020-02-02 17:27:52 CET
Hello,
I have a card reader and a smartcard.
Actually, I have pcscd.service enabled at start, according to MCC.
It is running, also.
When I manually stop it, then plug the reader, the service stays inactive. When I plug the card, the service still stays inactive.
And, before any test:
systemctl status pcscd.socket 
● pcscd.socket - PC/SC Smart Card Daemon Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/pcscd.socket; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-02-02 09:56:16 CET; 7h ago
   Listen: /run/pcscd.comm (Stream)
   CGroup: /system.slice/pcscd.socket

CC: (none) => yves.brungard_mageia

Comment 19 Martin Whitaker 2020-02-02 18:47:21 CET
(In reply to papoteur from comment #18)
> Hello,
> I have a card reader and a smartcard.
> Actually, I have pcscd.service enabled at start, according to MCC.
> It is running, also.
> When I manually stop it, then plug the reader, the service stays inactive.
> When I plug the card, the service still stays inactive.

According to the upstream maintainer (https://bugzilla.redhat.com/show_bug.cgi?id=1545027#c25), the expected behaviour is that the service starts when an application tries to access the card. So unless an application is automatically started when you plug in the card, I guess the service should remain inactive.

CC: isobuild => (none)

Comment 20 Herman Viaene 2020-02-03 10:12:43 CET
I just installed the beid-related packages and got the thing working, I had to start pcscd in MCC, as it is marked to run at startup, but not running after installation, just as other stuff like mysqld and httpd do. So far so good. Later (this afternoon or tomorrow) i will reboot this PC and report back.
Comment 21 Herman Viaene 2020-02-06 09:30:39 CET
In response to Comment 17:
After boot, card reader not plugged in:
# systemctl -a status pcscd.service
● pcscd.service - PC/SC Smart Card Daemon
   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; indirect; vendor preset: disabled)
   Active: active (running) since Thu 2020-02-06 09:21:19 CET; 2min 27s ago
     Docs: man:pcscd(8)
 Main PID: 9732 (pcscd)
   Memory: 1.7M
   CGroup: /system.slice/pcscd.service
           └─9732 /usr/sbin/pcscd --foreground --auto-exit

feb 06 09:21:19 mach5.hviaene.thuis systemd[1]: Started PC/SC Smart Card Daemon.

# systemctl -a status pcscd.socket
● pcscd.socket - PC/SC Smart Card Daemon Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/pcscd.socket; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-02-06 09:19:23 CET; 4min 51s ago
   Listen: /run/pcscd.comm (Stream)
   CGroup: /system.slice/pcscd.socket

feb 06 09:19:23 mach5.hviaene.thuis systemd[1]: Listening on PC/SC Smart Card Daemon Activation Socket.

Plug in card reader with eidcard inserted
# systemctl -a status pcscd.service
● pcscd.service - PC/SC Smart Card Daemon
   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; indirect; vendor preset: disabled)
   Active: active (running) since Thu 2020-02-06 09:21:19 CET; 3min 23s ago
     Docs: man:pcscd(8)
 Main PID: 9732 (pcscd)
   Memory: 2.3M
   CGroup: /system.slice/pcscd.service
           └─9732 /usr/sbin/pcscd --foreground --auto-exit

feb 06 09:21:19 mach5.hviaene.thuis systemd[1]: Started PC/SC Smart Card Daemon.

I was able to login to governement site using the eid as identification and authorisation.
Comment 22 Lewis Smith 2020-02-06 21:16:31 CET
Thanks Herman for all your tests.
Going back on this:
From comment 1:
> pcscd.service is actually not required to start
From comment 19:
> the expected behaviour is that the service starts when an application tries
> to access the card.
Are you willing to close the bug now? It looks very much as if things are happening as they should.
Comment 23 Herman Viaene 2020-02-06 21:22:34 CET
Yes, all seems OK now.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.