/etc/init.d/pcscd works only at first start.

Bug #1409081 reported by Wolf Pichler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcsc-lite (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

"/etc/init.d/pcscd *" resp. "service pcscd *" works only at first "start".
In all other cases it just does nothing resp. starts one more pcscd.

Examples:

root@liberty:/etc# service pcscd start
root@liberty:/etc# ps -ef|grep pcscd
root 3850 1884 0 16:09 pts/10 00:00:00 /usr/sbin/pcscd

root@liberty:/etc# service pcscd start
root@liberty:/etc# ps -ef|grep pcscd
root 3850 1884 0 16:09 pts/10 00:00:01 /usr/sbin/pcscd
root 5230 1884 0 17:49 pts/10 00:00:00 /usr/sbin/pcscd

root@liberty:/etc# service pcscd stop
root@liberty:/etc# ps -ef|grep pcscd
root 3850 1884 0 16:09 pts/10 00:00:01 /usr/sbin/pcscd
root 5230 1884 0 17:49 pts/10 00:00:00 /usr/sbin/pcscd

root@liberty:/etc# /etc/init.d/pcscd stop
root@liberty:/etc# ps -ef|grep pcscd
root 3850 1884 0 16:09 pts/10 00:00:01 /usr/sbin/pcscd
root 5230 1884 0 17:49 pts/10 00:00:00 /usr/sbin/pcscd

root@liberty:/etc# service pcscd restart
 * Restarting PCSC Lite resource manager pcscd [ OK ]
root@liberty:/etc# ps -ef|grep pcscd
root 3850 1884 0 16:09 pts/10 00:00:01 /usr/sbin/pcscd
root 5230 1884 0 17:49 pts/10 00:00:00 /usr/sbin/pcscd
root 5295 1884 0 17:52 pts/10 00:00:00 /usr/sbin/pcscd

###

The problem is caused by these lines in /etc/init.d/pcscd:

# create $IPCDIR with correct access rights
rm -rf $IPCDIR
mkdir $IPCDIR
chgrp pcscd $IPCDIR
chmod g+w $IPCDIR

Since PIDFILE=$IPCDIR/$NAME.pid it will be deleted by the first of these commands and
"start-stop-daemon" in /etc/init.d/pcscd using option "--pidfile $PIDFILE" can not work anymore.

Commenting the lines above makes the script work as expected (or at least as expected by _me_).

###

Another minor problem is the line "chgrp pcscd $IPCDIR" in the init script: Group pcscd does not exist.
Creating the group myself does not change anything, neither positive nor negative -
except for the fact that the group is then set on $IPCDIR:

wolf@liberty:/run$ ls -ld pcscd
drwxr-xr-x 2 root pcscd 80 Dez 22 17:52 pcscd

wolf@liberty:/run$ ls -l pcscd
total 4
srw-rw-rw- 1 root root 0 Dez 22 17:52 pcscd.comm
-rw-r--r-- 1 root root 6 Dez 22 17:52 pcscd.pid

###

pcscd --version
pcsc-lite version 1.8.10.
Copyright (C) 1999-2002 by David Corcoran <email address hidden>.
Copyright (C) 2001-2011 by Ludovic Rousseau <email address hidden>.
Copyright (C) 2003-2004 by Damien Sauveron <email address hidden>.
Report bugs to <email address hidden>.
Enabled features: Linux x86_64-pc-linux-gnu serial usb libudev usbdropdir=/usr/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/etc/reader.conf.d

apt-cache policy pcscd
pcscd:
  Installed: 1.8.10-1ubuntu1
  Candidate: 1.8.10-1ubuntu1
  Version table:
 *** 1.8.10-1ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

OS: Ubuntu 14.04 64bit
3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Wolf Pichler (w-pichler) wrote :

Since this is my first fault report here I probably made the mistake to assign it to pcsc-cyberjack instead to pcscd => trying to fix it right now ....

affects: pcsc-cyberjack (Ubuntu) → pcsc-lite (Ubuntu)
Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

pcscd version 1.8.10-1 should have:
    # create $IPCDIR with correct access rights
    if [ ! -d $IPCDIR ]
    then
        rm -rf $IPCDIR
        mkdir $IPCDIR
    fi
    chmod 0755 $IPCDIR

Maybe you should reinstall your pcscd package.

Revision history for this message
Wolf Pichler (w-pichler) wrote :

Wow ....

I figured out that /etc/init.d/pcscd is simply not getting installed by the package although it is contained in pcscd_1.8.10-1ubuntu1_amd64.deb.

This is why I still had an old version of it on my machine.

Since I am no package expert I just can guess that this happens because it is not in the DEBIAN/md5sums file of the package.

So as a workaround one has to copy it manually.

Is there anything I can/should do concerning this bug?

Thanks for the fast response!

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

This file is a conffile and is not managed like the other files of a package.

A local modification is not overwritten unless explicitly accepted by the admin. I guess you edited the file and refused to upgrade it during the install of a newer version of pcscd.

I will close the bug.

Changed in pcsc-lite (Ubuntu):
status: New → Fix Released
Revision history for this message
Wolf Pichler (w-pichler) wrote :

The only way to get /etc/init.d/pcscd installed is to first purge the pcscd package and then install it newly.

The installation process never asks whether or not to overwrite a modified version of the file - neither in Synaptic nor with apt-get on command line
.
Even if I delete /etc/init.d/pcscd and subsequently reinstall pcscd the file it is not going to be installed.

I repeated this several times, it always behaves like this.

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.