libchipcard64 should avoid polling (...every 10 seconds) by default

Bug #432008 reported by Paul Sladen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libchipcard (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

On default Ubuntu installs a daemon named 'chipcard64' is run, which sits in the background and polls every 10 seconds by attempting to 'accept()' a socket:

  $ sudo strace -r -p 3328
     0.000000 select(6, [5], NULL, NULL, {9, 682247}) = 0 (Timeout)
     9.683726 accept(5, 0xa06f8a8, [110]) = -1 EAGAIN (Resource temporarily unavailable)
     0.000226 select(6, [5], NULL, NULL, {10, 0}) = 0 (Timeout)
    10.010503 accept(5, 0xa06f8a8, [110]) = -1 EAGAIN (Resource temporarily unavailable)
     0.000152 select(6, [5], NULL, NULL, {10, 0}) = 0 (Timeout)
    10.010469 accept(5, 0xa06f8a8, [110]) = -1 EAGAIN (Resource temporarily unavailable)
     0.000153 select(6, [5], NULL, NULL, {10, 0}) = 0 (Timeout)
     ...

Ideally chipcard64 should be switched internally to an asynchronous model in order to avoid waking up every 10 seconds in order to poll. In additional, the startup mechanism should ideally be altered to be load the daemon dynamically via udev when suitable interrupt sources and events are available and to unload it again upon reader or device removal.

The daemon should definitely *not* be running if there is no suitable card reader installed on the machine in question.

Paul Sladen (sladen)
summary: - chipcard64 should using polling (once every 10 seconds)
+ chipcard64 should avoid polling (...every 10 seconds)
Paul Sladen (sladen)
Changed in libchipcard (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Micha Lenk (micha) wrote : Re: [Bug 432008] [NEW] chipcard64 should avoid polling (...every 10 seconds)

Hi Paul,

Unfortunately you didn't specify any versioning information. What
version of package libchipcard-tools is installed on your system?

Regards
  Micha

Revision history for this message
Paul Sladen (sladen) wrote : Re: chipcard64 should avoid polling (...every 10 seconds)

None anymore; according to:

  Log time: 2009-09-18 21:47:47.206251
  ...
  Investigating libchipcardc2
  Package libchipcardc2 has broken dep on libchipcard-data
    Considering libchipcard-data 10003 as a solution to libchipcardc2 3
    Removing libchipcardc2 rather than change libchipcard-data
  Investigating libchipcard-libgwenhywfar47-plugins
  Package libchipcard-libgwenhywfar47-plugins has broken dep on libchipcardc2
    Considering libchipcardc2 3 as a solution to libchipcard-libgwenhywfar47-plugins 0
    Removing libchipcard-libgwenhywfar47-plugins rather than change libchipcardc2
  Investigating libchipcard-tools
  Package libchipcard-tools has broken dep on libchipcardc2
    Considering libchipcardc2 3 as a solution to libchipcard-tools 0
    Removing libchipcard-tools rather than change libchipcardc2
  Investigating libchipcard-ctapi0
  Package libchipcard-ctapi0 has broken dep on libchipcard-data
    Considering libchipcard-data 10003 as a solution to libchipcard-ctapi0 0
    Removing libchipcard-ctapi0 rather than change libchipcard-data

Revision history for this message
Paul Sladen (sladen) wrote :

However, prior to that:

  $ dpkg -l | grep libchipcard | awk '{print $1,$2,$3}'
  rc libchipcard-ctapi0 4.2.8-1ubuntu1
  rc libchipcard-data 4.2.8-1ubuntu1
  rc libchipcard-tools 4.2.8-1ubuntu1
  rc libchipcardc2 4.2.8-1ubuntu1
  rc libchipcardd0 4.1.3-2ubuntu1

Revision history for this message
Micha Lenk (micha) wrote :

Are you still interested in fixing the bug?

This version of libchipcard should do event-based hardware device detection by default. If it doesn't, probably your configuration hasn't been updated to do so, when upgrading from libchipcard-data 4.1.3-2ubuntu1 to libchipcard-data 4.2.8-1ubuntu1.

Can you please submit the contents of the file /etc/chipcard/server/chipcardd.conf on your system?
Especially the value of the variable hardwareScanInterval in section DeviceManager is of interest. You can safely set it to zero with the libchipcard 4.2.8.

Revision history for this message
Micha Lenk (micha) wrote :

I consider this a configuration issue and hence will close the bug.

Revision history for this message
Micha Lenk (micha) wrote :

Answer:
You can disable polling of libchipcardd by editing the file etc/chipcard/server/chipcardd.conf and setting hardwareScanInterval to zero. The next time you start the chipcard daemon it should stop scanning for hardware by polling.

Changed in libchipcard (Ubuntu):
status: Confirmed → Invalid
summary: - chipcard64 should avoid polling (...every 10 seconds)
+ How do I deactivate chipcardd4 scanning every 10s for new hardware
+ devices?
Revision history for this message
Paul Sladen (sladen) wrote :

'/etc/chipcard/server/chipcardd.conf' as requested; this suggests (from the configuration) that it _should_ be relying on udev so there maybe a packaging issue that is causing it not to be found.

summary: - How do I deactivate chipcardd4 scanning every 10s for new hardware
- devices?
+ libchipcard64 should avoid polling (...every 10 seconds) by default
Changed in libchipcard (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Micha Lenk (micha) wrote : Re: [Bug 432008] Re: libchipcard64 should avoid polling (...every 10 seconds) by default

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Paul,

What reader do you have exactly?

Regards
  Micha
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq5U6MACgkQWN0/4pnhQbTjEQCg1FCtXbEsyapjZTdeEs6qe2wN
JsUAoOJ7a0TN9f2lCcOhsZkQMjaFNpMZ
=cA6v
-----END PGP SIGNATURE-----

Revision history for this message
Paul Sladen (sladen) wrote :

Micha: I'm not aware of having _any_ reader on this machine...

Revision history for this message
Micha Lenk (micha) wrote :

The submitter himself should not mark it as confirmed. Someone in the position to release a fix can do so.

I haven't triaged this bug on my own yet because I have no Ubuntu system for doing so. Let's keep it as "New" though, until someone really confirms this bug.

Changed in libchipcard (Ubuntu):
status: Confirmed → New
Revision history for this message
Micha Lenk (micha) wrote :

With libchipcard 5.0.0-1 in Ubuntu natty, there is no libchipcard daemon anymore. Hence I mark this bug as "Fix Released".

Changed in libchipcard (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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