LudovicRousseau / PCSC

pcsc-lite: PC/SC implementation
https://pcsclite.apdu.fr/
Other
271 stars 110 forks source link

Systemd complains "pcscd.service: Referenced but unset environment variable evaluates to an empty string: PCSCD_ARGS" #211

Closed iWolf1 closed 2 months ago

iWolf1 commented 2 months ago

Versions

pcsc-lite version 2.0.3. Copyright (C) 1999-2002 by David Corcoran corcoran@musclecard.com. Copyright (C) 2001-2022 by Ludovic Rousseau ludovic.rousseau@free.fr. Copyright (C) 2003-2004 by Damien Sauveron sauveron@labri.fr. Report bugs to pcsclite-muscle@lists.infradead.org. Enabled features: Linux aarch64-unknown-linux-gnu libsystemd serial usb libudev polkit usbdropdir=/usr/lib/pcsc/drivers ipcdir=/run/pcscd filter configdir=/etc/reader.conf.d MAX_READERNAME: 128, PCSCLITE_MAX_READERS_CONTEXTS: 16

Platform

Ubuntu 24.04.1 LTS

Issue

Install with default configuration.

No warnings or complaints.

Systemd complains "pcscd.service: Referenced but unset environment variable evaluates to an empty string: PCSCD_ARGS"

The problem is that the default pcscd.service uses $PCSCD_ARGS which it expects pulled from the non-existent EnvironmentFile

A default /etc/default/pcscd with PCSCD_ARGS set to the empty string is enough to get rid of the complaint.

Going a bit further actually documenting all the different environment variables pcscd uses in a single place would be useful.

I had a read through the code, and blog and came up with some quick notes as a starting point. Hope they help.

# PCSCD_ARGS is used in the systemd service unit to pass cli arguments to pcscd executable.
PCSCD_ARGS = ''

# Set to the numeric log level DEBUG (0), INFO (1), ERROR (2), CRITICAL (3)
# default is 4 to keep it quiet...
;PCSCLITE_DEBUG = 4

# Use a socket to talk to remote instance of libpcsclite.so ?
# https://blog.apdu.fr/posts/2010/11/pcsc-client-and-server-on-two-different/
;PCSCLITE_CSOCK_NAME =

# This seems related to Hot Plug drivers
#  The code on GitHub says /usr/local/... but the manpage on my system says /usr/lib/...
;PCSCLITE_HP_DROPDIR = "/usr/local/pcsc/drivers/"

# Seems to be a ":" separated string list to match against names you want to ignore
# https://blog.apdu.fr/posts/2015/12/remove-andor-customize-pcsc-reader-names/
;PCSCLITE_FILTER_IGNORE_READER_NAMES = ''

# User with above ignore list... example is set to " $HOSTNAME"
;PCSCLITE_FILTER_EXTEND_READER_NAMES =

# Setting this disables "shared blocking"; the value doesn't seem to matter.
;PCSCLITE_NO_BLOCKING =

# https://blog.apdu.fr/posts/2024/04/how-to-use-libpcsclite_delegate/
;LIBPCSCLITE_DELEGATE =
;LIBPCSCLITE_SPY_DELEGATE =
LudovicRousseau commented 2 months ago

Nice suggestion. I will work on it.

LudovicRousseau commented 2 months ago

Thanks