When I hot plug a usb token openct does not handle it

Asked by David O'Callaghan

Since upgrading to Jaunty I find that when I hot plug an usb crypto token (an Aladdin eToken initialised with OpenSC) openct does not handle or recognise it unless I restart openct. This used to work under Intrepid. I was able to plug in the token and then, for example, it would be available to Firefox, etc.

Now, when I plug it in there are a few USB-related log messages but, for example, pkcs11-tool -L does not list the token. If I restart openct (/etc/init.d/openct restart) the token can be detected by pkcs11-tool. However, I must restart Firefox for the token to be made available to it.

I'd like to find out how to get back to the old behaviour. I'm happy to provide more detail from logs, etc. on request.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu openct Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andreas Schantin (andreas-schantin) said :
#1

Though the question is rather old, here's a solution to it:
It seems that there are two little things that cause the problems with openct and hotplugging usb tokens. First of all in /udev/rules.d/40-openct.rules

Line 27 looks like this:
ENV{MODALIAS}=="usb:v0529p0514", RUN+="/lib/udev/openct_usb"

But since the environment variable $MODALIAS only starts with "usb:v0529p0514..." the rule never matches. I suppose somebody forgot the asterisk and it should look like:
ENV{MODALIAS}=="usb:v0529p0514*", RUN+="/lib/udev/openct_usb"

After fixing this line udevd actually runs /lib/udev/openct_usb which fails with an error because 'udevinfo' cannot be found. Indeed 'udevinfo' doesn't seem to exist anymore. Changing line 10 from:
        DEVNAME=/dev/$(udevinfo --query=name --path=$(dirname $DEVPATH))
to
        DEVNAME=/dev/$(udevadm info --query=name --path=$(dirname $DEVPATH))
should solve do the trick.

Revision history for this message
Andreas Schantin (andreas-schantin) said :
#2

Well seems like the question was answered a long time ago in Bug #246392. Which is still not fixed sadly.

Can you help with this problem?

Provide an answer of your own, or ask David O'Callaghan for more information if necessary.

To post a message you must log in.