On 09/04/2011 01:30 AM, Ludovic Rousseau wrote:
> On my Debian system systemd does not create the socket :-(
> Could it be because the socket name is /var/run/pcscd/pcscd.comm but
> the directory /var/run/pcscd does not exist?
>
> I have to run "systemctl start pcscd.service" manualy.
My guess is that the pcscd.socket unit file isn't started and that's why
systemd doesn't create the socket for you. Try running 'systemctl start
pcscd.socket'.
Testing latest svn:
# ls -l /var/run/pcscd
ls: cannot access /var/run/pcscd: No such file or directory
# opensc-tool -l
No smart card readers found.
# systemctl start pcscd.socket
# ls -l /var/run/pcscd
total 0
srw-rw-rw-. 1 root root 0 Sep 4 11:54 pcscd.comm
# ps aux | grep pcsc
# opensc-tool -l
# Detected readers (pcsc)
Nr. Card Features Name
0 No HP USB Smart Card Keyboard [CCID Interface]
(0817bcc3) 00 00
1 No SCM SCR 331 [CCID Interface] (50400844) 01 00
2 No PIN pad SCM SPR 532 [Vendor Interface] (040001EF) 02 00
3 No Alcor Micro AU9520 03 00
# ps aux | grep pcsc
root 5616 2.0 0.0 461932 3756 ? Ssl 11:54 0:00
/usr/sbin/pcscd --foreground
> Note that if the socket if found then pcscd will consider another
> pcscd is already running and will try to open the
> /var/run/pcscd/pcscd.pid file to get the pid of the other pcscd
> process. If pcscd is started by systemd the socket will be present but
> the pcscd.pid will not be there and pcscd will complain and exit.
I think you are missing 'systemctl start pcscd.socket'. I just tested
latest svn trunk with and without --disable-autostart and the socket
activation appeared to work in both configurations.
> I my logs I have:
[...]
> utils.c:53:GetDaemonPid() Can't open /var/run/pcscd/pcscd.pid: No such
> file or directory
> Sep 4 00:20:09 debian pcscd[19475]: 00000000
> utils.c:53:GetDaemonPid() Can't open /var/run/pcscd/pcscd.pid: No such
> file or directory
> Sep 4 00:20:09 debian systemd[1]: pcscd.service start request
> repeated too quickly, refusing to start.
> Sep 4 00:20:09 debian systemd[1]: pcscd.service start request
> repeated too quickly, refusing to start.
This is most likely hitting the SocketActivated = FALSE code path
because systemd didn't pass any file descriptors to pcscd. Have you
tried to insert any instrumentation in the code to see if that's the
case?
/*
* Check if systemd passed us any file descriptors
*/
rv = sd_listen_fds(0);
if (rv > 1)
{
Log1(PCSC_LOG_CRITICAL, "Too many file descriptors received");
return EXIT_FAILURE;
}
else if (rv == 1)
SocketActivated = TRUE;
else
SocketActivated = FALSE;
Anyway, I am pretty sure it's not working for you because the
pcscd.socket unit isn't started.
'systemctl enable pcscd.socket' enables socket activation so that the
pcscd.socket unit is started on next reboot, and
'systemctl start pcscd.socket' starts the unit right away.
> I don't know how it can work on Fedora. Have you made other changes
> you have not sent me?
No other changes. See for yourself:
http://pkgs.fedoraproject.org/gitweb/?p=pcsc-lite.git;a=tree;h=refs/heads/master;hb=master
> I committed your changes in subversion revisions 5929, 5931 and 5933.
> You can get a snapshot of pcsc-lite at [1]. Please tell me if you are
> OK with the code.
Tested it and everything looks good, thanks!
--
Kalev
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle