diff --git a/ci/spec/pre b/ci/spec/pre index 114ead96..65377ec1 100644 --- a/ci/spec/pre +++ b/ci/spec/pre @@ -1,7 +1,11 @@ %pre if [ x"$(which systemctl)" != x"" ]; then - systemctl stop cvmfs-gateway + if [ "x$(systemctl list-unit-files | grep cvmfs-gateway)" != "x" ]; then + systemctl stop cvmfs-gateway + fi else - /usr/libexec/cvmfs-gateway/scripts/run_cvmfs_gateway.sh stop + if [ -x /usr/libexec/cvmfs-gateway/scripts/run_cvmfs_gateway.sh ]; then + /usr/libexec/cvmfs-gateway/scripts/run_cvmfs_gateway.sh stop + fi fi diff --git a/ci/spec/preun b/ci/spec/preun index 7d0c94d9..5aed48ff 100644 --- a/ci/spec/preun +++ b/ci/spec/preun @@ -1,7 +1,11 @@ %preun if [ x"$(which systemctl)" != x"" ]; then - systemctl stop cvmfs-gateway + if [ "x$(systemctl list-unit-files | greo cvmfs-gateway)" != "x" ]; then + systemctl stop cvmfs-gateway + fi else - /usr/libexec/cvmfs-gateway/scripts/run_cvmfs_gateway.sh stop + if [ -x /usr/libexec/cvmfs-gateway/scripts/run_cvmfs_gateway.sh ]; then + /usr/libexec/cvmfs-gateway/scripts/run_cvmfs_gateway.sh stop + fi fi