pcscd

When starting pcscd with rcpcscd start after upgrade from 12.1 to 12.2 pcscd is started with: /usr/sbin/pcscd --foreground --auto-exitIt does not work at all. I have to manually stop it and start it from the command line manually without systemctl. I am not familiar with systemd, how do I change it to start it without the extra parameters? And why does it use --foreground?

Please open bug report on bugzilla. But you should be more specific than “does not work at all”.

I am not familiar with systemd, how do I change it to start it without the extra parameters?

It may not be so easy, but …

  • first check service definition used by systemd:
bor@opensuse:~> systemctl status pcscd.service
pcscd.service - PC/SC Smart Card Daemon
      Loaded: loaded (/lib/systemd/system/pcscd.service; static)
      Active: inactive (dead)
      CGroup: name=systemd:/system/pcscd.service
  • now copy /lib/systemd/system/pcscd.service to /etc/systemd/system
  • now edit /etc/systemd/system/pcscd.service and adjust ExecStart line
  • now issue “systemctl daemon-reload” to read new definition.

But it may not be as easy …

As far as I can see from service definition, it is supposed to be socket-activated. It means - systemd starts pcscd.socket and listens on requests. As soon as request comes in systemd starts service itself via pcscd.service. So when service has nothing to do it just exist (hence --auto-exit) and is started again when required. If this mechanism does not work, it is a bug and should be reported.

And why does it use --foreground?

Because it is the recommended way to start services under systemd. Systemd does all necessary forking for each service, and monitors child process. If it terminates abnormally, it immediately knows about it and can optionally restart it. Additionally it collects all (error) output from process so you can also see any error messages in this case.

Unfortunately it is hard to make any guess based on “does not work”. For a start - what does “systemctl status pcscd.socket” says? Does /var/run/pcscd/pcscd.comm exist?

What I mean by does not work, is that the smart card in the reader is not loaded like it does if I start pcscd outside of systemd.

pcscd.socket - PC/SC Smart Card Daemon Activation Socket
Loaded: loaded (/lib/systemd/system/pcscd.socket; enabled)
Active: active (listening) since Thu, 27 Dec 2012 01:27:41 +0100; 14h ago
CGroup: name=systemd:/system/pcscd.socket

/var/run/pcscd/pcscd.comm does not exist.

However if I start pcscd from the command line, /var/run/pcscd/pcscd.comm exists and pcscd is working.

Also if I start it from the command line with the same options --foreground --auto-exit, it works.

So I think the problem is in systemd.

It exists here, so looks like something removes it.

bor@opensuse:~> systemctl status pcscd.socket
pcscd.socket - PC/SC Smart Card Daemon Activation Socket
      Loaded: loaded (/lib/systemd/system/pcscd.socket; enabled)
      Active: active (listening) since Sun, 23 Dec 2012 22:46:50 +0400; 3 days ago
      CGroup: name=systemd:/system/pcscd.socket

bor@opensuse:~> LC_ALL=C ll /var/run/pcscd/
total 0
srw-rw-rw- 1 root root 0 Dec 23 22:46 pcscd.comm

Could you try

systemctl stop pcscd.socket
rm -rf /var/run/pcscd/
systemctl start pcscd.socket

Does socket get created?

Looks like the systemctl socket command did the trick. Now it works fine, I also tested to reboot the machine and it still works. Thanks for the quick response.