From 05466448c2f805cea19300f9d05f1319f927cce8 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 5 Apr 2019 13:02:30 +0200 Subject: [PATCH] Attempt to start the socket after installation (#1545027) --- pcsc-lite.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pcsc-lite.spec b/pcsc-lite.spec index 7d3d4ab..84d1887 100644 --- a/pcsc-lite.spec +++ b/pcsc-lite.spec @@ -108,6 +108,15 @@ rm $RPM_BUILD_ROOT%{_docdir}/pcsc-lite/README.DAEMON %post %systemd_post pcscd.socket pcscd.service +# If install, test if pcscd socket is enabled. +# If enabled, then attempt to start it. This will silently fail +# in chroots or other environments where services aren't expected +# to be started. +if [ $1 -eq 1 ] ; then + if systemctl -q is-enabled pcscd.socket > /dev/null 2>&1 ; then + systemctl start pcscd.socket > /dev/null 2>&1 || : + fi +fi %preun %systemd_preun pcscd.socket pcscd.service