• Ludovic Rousseau's avatar
    Exit with EXIT_SUCCESS on shutdown to please systemd · 3896019c
    Ludovic Rousseau authored
    From Jakub Jelen nice bug report:
    " The pcscd daemon exits with exit code 1 when it is killed by systemd,
    which confuses system thinking that there was some failure on the exit:
    
    Sep 11 13:22:54 workstation-uefi pcscd[8750]: 08450216 pcscdaemon.c:193:signal_thread() Received signal: 15
    Sep 11 13:22:54 workstation-uefi pcscd[8750]: 00000015 pcscdaemon.c:213:signal_thread() Direct suicide
    Sep 11 13:22:54 workstation-uefi pcscd[8750]: 00000004 pcscdaemon.c:786:at_exit() cleaning /var/run/pcscd
    Sep 11 13:22:54 workstation-uefi systemd[1]: Stopping PC/SC Smart Card Daemon...
    Sep 11 13:22:54 workstation-uefi systemd[1]: pcscd.service: Main process exited, code=exited, status=1/FAILURE
    Sep 11 13:22:54 workstation-uefi systemd[1]: pcscd.service: Failed with result 'exit-code'.
    Sep 11 13:22:54 workstation-uefi systemd[1]: Stopped PC/SC Smart Card Daemon.
    
    Reading through the code, it looks like it exits always with 1 (except
    for the alarm) so I think we should either
    
    - modify the shipped systemd service file to mark the exit code 1 as a
      successful exit code using SuccessExitStatus or - sign in front of
      ExecStart.
    - modify the pcscd to exit "cleanly" in case of termination by systemd.
    
    I do not have any strong opinions which way is more correct, nor the
    systemd maintainers do so this is merely cosmetic issue avoiding bogus
    error messages filling log files on every reboot.
    
    Initially filled as a Fedora bug:
    https://bugzilla.redhat.com/show_bug.cgi?id=1751153 "
    
    I implemented the second solution.
    
    Fixes https://github.com/LudovicRousseau/PCSC/issues/70
    "Unclean exit when the pcscd is killed by systemd (for example on reboot)"
    3896019c
Name
Last commit
Last update
UnitaryTests Loading commit data...
doc Loading commit data...
etc Loading commit data...
m4 Loading commit data...
src Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
GPL-3.0.txt Loading commit data...
HELP Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
README.md Loading commit data...
SECURITY Loading commit data...
TODO Loading commit data...
bootstrap Loading commit data...
c.sh Loading commit data...
clang-analyze.sh Loading commit data...
configure.ac Loading commit data...
splint.sh Loading commit data...
stamp-h.in Loading commit data...