Bug 466430

Summary: pcscd daemon is not started automatically
Product: [openSUSE] openSUSE 11.1 Reporter: Ludovic Rousseau <ludovic.rousseau>
Component: OtherAssignee: Stanislav Brabec <sbrabec>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Blocker    
Priority: P2 - High CC: lnussel, ludovic.rousseau, ro
Version: RC 2   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on: 499734    
Bug Blocks:    

Description Ludovic Rousseau 2009-01-15 15:04:38 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.14eol) Gecko/20070505 (Debian-1.8.0.15~pre080614i-0etch1) Galeon/2.0.2 (Debian package 2.0.2-4)

The script /etc/init.d/pcscd is not executed from any run level.

I can activate the service using YaST -> System -> Services but I think it would be more user friendly if the daemon is running just by installing the pcsc-lite package.

Reproducible: Always

Steps to Reproduce:
1. install pcsc-lite package
2. restart the system
Actual Results:  
pcscd not started

Expected Results:  
pcscd started
Comment 1 Alexander Orlovskyy 2009-01-16 13:11:09 UTC
Stanislav, can you comment on bug?
Comment 2 Stanislav Brabec 2009-01-16 16:28:04 UTC
Most people does not have a Smart Card reader and Smart Cards daemon only takes space. On the other hand, people having it have to find an un-intuitive solution.

I am not sure, what would be the best solution?

1. Run it every time.

2. Run it every time, but make all steps to exclude pcsc-lite from basic installation. Now it is introduced by dependency chain: openssh -> libopensc2 -> opensc -> pcsc-lite into "Extended basic system" pattern

3. Try to detect it. If it is a detectable reader, use HAL magic to start it. (Note that pcscd is not ready to become a HAL helper).

4. Use an install time magic.

5. Handle it as a part of a new YaST GUI (reqested by FATE#302132).


Ludwig, what do you think? I would prefer 2. + magic hardware supplements, which will auto-select proper packages, if the hardware is present.
Comment 3 Ludovic Rousseau 2009-01-16 17:08:50 UTC
option 3 is planned in a future version of pcsc-lite (see [1]).

If pcscd is installed because of openssh it may be correct to NOT start pcscd since a lot of users do not need it. It is not very hard to start it using YaST. This bug can be closed when option 3 is working.

Why do you say: "pcscd is not ready to become a HAL helper"? What is missing?

[1] https://alioth.debian.org/tracker/index.php?func=detail&aid=310918&group_id=30105&atid=410088
Comment 4 Stanislav Brabec 2009-01-16 23:39:46 UTC
2.1 Actually, openssh would be happy with libraries only, unless user explicitly requests Smart Card support. Splitting package and removing dependency library => core would solve this part (It was itroduced by a logic: library is called => calls should really work, but this logic seems to introduce lot of unneeded dependencies. Abandoning this logic seems to be useful.)

2.2 New ZYPP has a feature of hardware supplements. When hardware appears, software management will suggest package installation.

> pcscd is not ready to become a HAL helper

Ah sorry. Package needs --enable-libhal.

Then the fixing of "Testing SCardEstablishContext : Service not available." will be sufficient and the bug in question will become obsolete. (But one will still need to create a special config file to make serial reader working.)

To Ludwig: As SLE11 will not see upgrade, what do you think about starting/not starting for SLE11.
Comment 5 Ludovic Rousseau 2009-01-17 12:13:00 UTC
On Debian libpcsclite.so.1 and pcscd are in two different packages. Installing libpcsclite1 does not force the installation of pcscd. The relation between the two was a Depends but is now a Suggests. See Debian bug #476483 http://bugs.debian.org/476483
Comment 6 Ludwig Nussel 2009-01-19 08:10:06 UTC
IMO for SLE11/11.1 keep current state. If there really is a strong customer demand for having this feature enabled by default use 3).

For 11.2 implement everything except 1. :)
Comment 7 Stanislav Brabec 2009-01-21 16:04:29 UTC
I'll split the package to exclude it from the base system.

Then I'll prepare hardware supplements for semi-automatic installation.

And yes, pcscd (1.4.102) does not contain hal helper yet. It uses HAL to evaluate devices, but hotplug is done via udev, not via HAL helper. I'll try to write one altogether with permission control.
Comment 8 Ludovic Rousseau 2009-01-22 07:46:08 UTC
Stanislav, pcscd used HAL only. My CCID driver may use udev if configured with --enable-udev

But maybe I do not understand what you wrote.

What do you call a HAL helper? A script that will call "pcscd --hotplug" when a reader is inserted/removed? This should not be needed with pcscd compiled with HAL since HAL events are reveived by pcscd directly.
Comment 9 Stanislav Brabec 2009-01-22 13:29:25 UTC
Well, now I understand. pcscd is started from the init script and listens to hal directly, without need for hal or udev helper.

In this case the documentation is outdated: pcsc-lite-1.5.1/doc/ifdhandler-3.tex proposes to install udev handler. I did so expecting, that it is required even with HAL support. I'll remove it binding.


I am not sure, how you plan to implement pcscd start on demand. Both dbus and hal are capable to do it, using a SUID helper started by library access is possible as well. In any case, it should be able to handle error "pcscd is not installed", which may happen due to package splitting.
Comment 10 Ludovic Rousseau 2009-01-22 13:58:20 UTC
I just corrected the documentation in revision 3290. Yes, it was outdated. Sorry.

Starting pcscd on demand not when a reader is connected by when an application calls SCardEstablishContext(). If the package is not installed the error SCARD_E_NO_SERVICE will be returned to the application.
Comment 11 Stanislav Brabec 2009-04-07 15:54:27 UTC
Fix submitted to Factory:

- Package is properly split and not introduced via dependencies by default any more.

- Driver packages are suggested or recommended via modalias supplements, pcsc-lite is introduced as dependency of these driver packages (work in progress).

- pcscd is started by default.


Check-in will wait for security team review.
Comment 12 Stanislav Brabec 2009-04-09 14:13:15 UTC
According to bug 438131 comment 32 changing the start policy from "force start while upgrading" for pcsc and openct to "force start in new installations, keep previous status otherwise".
Comment 13 Ruediger Oertel 2009-07-30 09:56:24 UTC
pcsc-lite is pulled into a default install (again).
combined with being started by default this is a no-go.

Fatou:/etc/init.d # rpm -e pcsc-lite
error: Failed dependencies:
        pcsc-lite is needed by (installed) opensc-0.11.8-1.11.x86_64
Fatou:/etc/init.d # rpm -e pcsc-lite opensc
error: Failed dependencies:
        opensc >= 0.11.8 is needed by (installed) libopensc2-0.11.8-1.11.x86_64
Fatou:/etc/init.d # rpm -e pcsc-lite opensc libopensc2
error: Failed dependencies:
        libopensc.so.2()(64bit) is needed by (installed) openssh-5.2p1-6.3.x86_64
        libscconf.so.2()(64bit) is needed by (installed) openssh-5.2p1-6.3.x86_64
Comment 14 Stanislav Brabec 2009-07-30 10:51:47 UTC
There was overseen "Requires: %{name} >= %{version}" in libopensc2.

Removing and submitting to Factory (request id 15909).