From 5fcba137c0394d2029471906e29900e50915d855 Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Tue, 2 Feb 2021 02:53:35 +0900 Subject: [PATCH] dist/redhat: stop using systemd macros, call systemctl directly Fedora version of systemd macros does not work correctly on CentOS7, since CentOS7 does not support "file trigger" feature. Even after 05d4378, scriptlets on old scylla .rpm and new scylla .rpm is not completely same. To fix the issue we need to stop using systemd macros, call systemctl directly. Fixes #94 (cherry picked from commit 949cefc2515a0c72e38d10f82517fc12f6bbfab7) --- dist/redhat/scylla-jmx.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dist/redhat/scylla-jmx.spec b/dist/redhat/scylla-jmx.spec index d8e19bc..59ee965 100644 --- a/dist/redhat/scylla-jmx.spec +++ b/dist/redhat/scylla-jmx.spec @@ -38,14 +38,20 @@ echo fi %post -%systemd_post scylla-jmx.service +if [ $1 -eq 1 ] ; then + /usr/bin/systemctl preset scylla-jmx.service ||: +fi + /usr/bin/systemctl daemon-reload ||: %preun -%systemd_preun scylla-jmx.service +if [ $1 -eq 0 ] ; then + /usr/bin/systemctl --no-reload disable scylla-jmx.service ||: + /usr/bin/systemctl stop scylla-jmx.service ||: +fi %postun -%systemd_postun scylla-jmx.service +/usr/bin/systemctl daemon-reload ||: %clean rm -rf $RPM_BUILD_ROOT