Bug 904244

Summary: PCSCD service not starting
Product: [openSUSE] openSUSE Distribution Reporter: Cedric Simon <cedric>
Component: OtherAssignee: E-mail List <bnc-team-screening>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: cedric
Version: 13.2   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Cedric Simon 2014-11-06 16:50:52 UTC
Under openSuse 13.2, the pcscd service is not starting.

service pcscd status
pcscd.service - PC/SC Smart Card Daemon
   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; static)
   Active: failed (Result: exit-code) since Thu 2014-11-06 10:43:53 CST; 38s ago
  Process: 25774 ExecStart=/usr/sbin/pcscd --foreground --auto-exit $PCSCD_OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 25774 (code=exited, status=1/FAILURE)

Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: --info                display info level debug messages
Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: -e  --error                display error level debug messages (default level)
Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: -C  --critical        display critical only level debug messages
Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: --force-reader-polling ignore the IFD_GENERATE_HOTPLUG reader capability
Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: -t, --max-thread        maximum number of threads (default 200)
Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: -s, --max-card-handle-per-thread        maximum number of card handle per thread (default: 200)
Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: -r, --max-card-handle-per-reader        maximum number of card handle per reader (default: 200)
Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: -x, --auto-exit        pcscd will quit after 60 seconds of inactivity
Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: -S, --reader-name-no-serial    do not include the USB serial number in the name
Nov 06 10:43:53 xps17.clinsis.com pcscd[25774]: -I, --reader-name-no-interface do not include the USB interface name in the name
Comment 1 Cedric Simon 2014-11-06 16:53:48 UTC
Solved by modifying the file /usr/lib/systemd/system/pcscd.service

Remove the $PCSCD_OPTIONS on line 8.

I am not sure what $PCSCD_OPTIONS is used for...

New content:
[Unit]
Description=PC/SC Smart Card Daemon
Requires=pcscd.socket

[Service]
Environment=PCSCD_OPTIONS=""
EnvironmentFile=-/etc/sysconfig/pcscd
ExecStart=/usr/sbin/pcscd --foreground --auto-exit
ExecReload=/usr/sbin/pcscd --hotplug

[Install]
Also=pcscd.socket
Comment 2 Cedric Simon 2014-11-06 17:13:47 UTC
System now starts but card not read.

rcpcscd status
pcscd.service - PC/SC Smart Card Daemon
   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; static)
   Active: active (running) since Thu 2014-11-06 11:09:10 CST; 4s ago
 Main PID: 27046 (pcscd)
   CGroup: /system.slice/pcscd.service
           `-27046 /usr/sbin/pcscd --foreground --auto-exit

Nov 06 11:09:10 xps17.clinsis.com pcscd[27046]: 00000000 utils.c:87:GetDaemonPid() Can't open /var/run/pcscd/pcscd.pid: No such file or directory

Note that /var/run/pcscd/pcscd.pid exists and is owned by root.

When running "pcscd" as root, then card can be read, but only if application running as root :S

Any idea how to fix this to have card read from normal user, using service (and not pcscd directly)?
Comment 3 Cedric Simon 2014-11-06 17:40:27 UTC
(In reply to Cedric Simon from comment #1)
> Solved by modifying the file /usr/lib/systemd/system/pcscd.service
> 
> Remove the $PCSCD_OPTIONS on line 8.
> 
> I am not sure what $PCSCD_OPTIONS is used for...
> 
> New content:
> [Unit]
> Description=PC/SC Smart Card Daemon
> Requires=pcscd.socket
> 
> [Service]
> Environment=PCSCD_OPTIONS=""
> EnvironmentFile=-/etc/sysconfig/pcscd
> ExecStart=/usr/sbin/pcscd --foreground --auto-exit
> ExecReload=/usr/sbin/pcscd --hotplug
> 
> [Install]
> Also=pcscd.socket

As stated in http://lists.opensuse.org/opensuse-bugs/2014-10/msg03651.html the $PCSCD_OPTIONS could stay is replacing the "" by " at the end, when declared.
Comment 4 Cedric Simon 2014-11-06 17:50:11 UTC
Duplicated of 900115

*** This bug has been marked as a duplicate of bug 900115 ***