pcscd no longer starts on Lucid

Bug #506908 reported by Torsten Spindler
44
This bug affects 6 people
Affects Status Importance Assigned to Milestone
pcsc-lite (Ubuntu)
Fix Released
Medium
Reinhard Tartler
Nominated for Karmic by Laurent Bigonville
Nominated for Lucid by Laurent Bigonville

Bug Description

As HAL is no longer started during boot time in Lucid, pcscd seems to no longer start:

Feb 22 14:34:15 wm0828 pcscd: hotplug_libhal.c:490:HPRegisterForHotplugEvents() Could not initialise connection to hald.
Feb 22 14:34:15 wm0828 pcscd: hotplug_libhal.c:491:HPRegisterForHotplugEvents() Normally this means the HAL daemon (hald) is not running or not ready.
Feb 22 14:34:15 wm0828 pcscd: pcscdaemon.c:524:main() SVCServiceRunLoop returned

This is fixable by using the --without-hal compile option for pcscd.

Independent of the HAL problem an upstart job for pcscd has been provided in this bug report. This might be needed for better integration with the upstart driven gdm.

Revision history for this message
Dominik (domfi) wrote :

If pcscd should handle PCMCIA-based SmartcardReader it is necessary that pcmcia is ready and has found all devices before pcscd is started. After Start of pcscd it needs some time to initialize itself (finding all smartcardreaders, etc.).

Other resources like GDM (Smartcard-based login) and NetworkManager (Smartcard-based VPN) should wait for pcscd to be ready (if it is installed)!

As a starting point I've written an upstart init script (attached). This script emits a signal after pcscd has been started and settled down (sleep 5). I know this is ugly, but as stated before simply starting pcscd -- and after that the NetworkManager/GDM -- can lead to a kind of "race condition".

I've also changed the upstart init script for NetworkManager and GDM to wait for the emited signal.

Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote : Re: [Bug 506908] Re: Upstart job for pcscd

2010/2/5 Dominik <email address hidden>:
> If pcscd should handle PCMCIA-based SmartcardReader it is necessary that
> pcmcia is ready and has found all devices before pcscd is started. After
> Start of pcscd it needs some time to initialize itself (finding all
> smartcardreaders, etc.).

PCMCIA readers can be hotpluged. When the reader is plugged or
unplugged just execute "pcscd --hotplug". I guess a udev rule can do
that. No need to wait after PCMCIA is setup.

> Other resources like GDM (Smartcard-based login) and NetworkManager
> (Smartcard-based VPN) should wait for pcscd to be ready (if it is
> installed)!

They should wait for pcscd to _start_, not be _ready_. If pcscd is
started but not ready yet the application using it will be blocked in
SCardEstablishContext() until pcscd is readry to answer.

> As a starting point I've written an upstart init script (attached).
> This script emits a signal after pcscd has been started and settled down
> (sleep 5). I know this is ugly, but as stated before simply starting
> pcscd -- and after that the NetworkManager/GDM -- can lead to a kind of
> "race condition".
>
> I've also changed the upstart init script for NetworkManager and GDM to
> wait for the emited signal.

The next version of pcscd will not be started at startup but when an
application needs it. You can already play with the beta at [1]. What
is still missing is the udev rule to correctly set the access rights
to the readers.

Bye

[1] http://ludovic.rousseau.free.fr/softwares/pcsc-lite/

--
 Dr. Ludovic Rousseau

Revision history for this message
Torsten Spindler (tspindler) wrote :

Will the next version of pcsc be ready to be included in Lucid? Or is
the targeted release date later than this month, February?

Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

2010/2/5 Torsten Spindler <email address hidden>:
> Will the next version of pcsc be ready to be included in Lucid? Or is
> the targeted release date later than this month, February?

The new version will have (too) many changes. I do not plan to push it
in Lucid (LTS) or the next Debian stable.

Bye

--
 Dr. Ludovic Rousseau

Revision history for this message
Torsten Spindler (tspindler) wrote :

On Fri, 2010-02-05 at 13:42 +0000, Ludovic Rousseau wrote:
...
> The new version will have (too) many changes. I do not plan to push it
> in Lucid (LTS) or the next Debian stable.

Given that, would you mind integrating the upstart job of Dominik for
Lucid?

Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

2010/2/5 Torsten Spindler <email address hidden>:
> On Fri, 2010-02-05 at 13:42 +0000, Ludovic Rousseau wrote:
> ...
>> The new version will have (too) many changes. I do not plan to push it
>> in Lucid (LTS) or the next Debian stable.
>
> Given that, would you mind integrating the upstart job of Dominik for
> Lucid?

I maintain the upstream and Debian package, not the Ubuntu package.

I think the upstart script should be included in the Ubuntu package
only. I don't think I can help.

Bye

--
 Dr. Ludovic Rousseau

Revision history for this message
Ilya Barygin (randomaction) wrote : Re: Upstart job for pcscd

Thank you for providing this script. We need a debdiff to sponsor your upload, see https://wiki.ubuntu.com/MOTU/Contributing for instructions on how to produce it. I'm unsubscribing ubuntu-universe-sponsors for now, please subscribe again when there is a debdiff to sponsor.

Re Debian/Ubuntu, maybe it would be possible to determine the distribution at package build time using dpkg-vendor and install the script only if necessary? If we introduce this divergence, someone would need to merge changes from Debian regularly.

Revision history for this message
Torsten Spindler (tspindler) wrote :

Attached is the debdiff for Dominik's upstart script.

Revision history for this message
Stephan Rügamer (sruegamer) wrote :

Thorsten,

your changelog was missing the correct distribution (lucid instead of unstable)
and your changelog was missing the (LP: #<bugno>) tag for closing this bug report.

I adjusted your diff without removing your tagline.

Thx,

\sh

Changed in pcsc-lite (Ubuntu):
assignee: nobody → Stephan Hermann (shermann)
status: New → In Progress
Revision history for this message
Stephan Rügamer (sruegamer) wrote :

bah...I can't upload to main ;)

Please find attached the "updated" debdiff of Torsten.

Please upload :)

Thx,

\sh

Changed in pcsc-lite (Ubuntu):
assignee: Stephan Hermann (shermann) → nobody
Changed in pcsc-lite (Ubuntu):
importance: Undecided → Medium
summary: - Upstart job for pcscd
+ pcscd no longer starts on Lucid
description: updated
description: updated
description: updated
Revision history for this message
Laurent Bigonville (bigon) wrote :

Same issue on both karmic and lucid.

Revision history for this message
Mathias Gug (mathiaz) wrote :

Given that we're passed FeatureFreeze for lucid adding an upstart job would require a FeatureFreeze Exception.

Moreover I don't think that providing an upstart job for pcscd that emits a specifc signal would be the correct option. As mentioned modifications to the gdm and network manager upstart jobs would *also* be required. And I don't think that upstart support conditional events (ie being able to express if pcsds is installed, wait for its event).

I'd recommend to use the --without-hal compile option for pcscd instead and leave upstart integration for the next release cycle.

Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

Using --without-hal looks like a good compromise for me (if that solve the problem).

pcscd will use more CPU ressources using libusb but at least will work.

Changed in pcsc-lite (Ubuntu):
assignee: nobody → Reinhard Tartler (siretart)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pcsc-lite - 1.5.3-1ubuntu3

---------------
pcsc-lite (1.5.3-1ubuntu3) lucid; urgency=low

  * disable hal support. LP: #506908
 -- Reinhard Tartler <email address hidden> Sun, 07 Mar 2010 21:32:18 +0100

Changed in pcsc-lite (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.