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.
To fix the issue we need to stop using systemd macros, call systemctl
directly.

See scylladb/scylla-jmx#94

Closes #8005

(cherry picked from commit 7b310c591e)
This commit is contained in:
Takuya ASADA
2021-02-02 05:01:30 +09:00
committed by Avi Kivity
parent 61145af5d9
commit cc050fd499

View File

@@ -78,13 +78,18 @@ getent passwd scylla || /usr/sbin/useradd -g scylla -s /sbin/nologin -r -d %{_sh
%post server
/opt/scylladb/scripts/scylla_post_install.sh
%systemd_post scylla-server.service
if [ $1 -eq 1 ] ; then
/usr/bin/systemctl preset scylla-server.service ||:
fi
%preun server
%systemd_preun scylla-server.service
if [ $1 -eq 0 ] ; then
/usr/bin/systemctl --no-reload disable scylla-server.service ||:
/usr/bin/systemctl stop scylla-server.service ||:
fi
%postun server
%systemd_postun scylla-server.service
/usr/bin/systemctl daemon-reload ||:
%posttrans server
if [ -d /tmp/%{name}-%{version}-%{release} ]; then
@@ -223,10 +228,18 @@ URL: https://github.com/prometheus/node_exporter
Prometheus exporter for machine metrics, written in Go with pluggable metric collectors.
%post node-exporter
%systemd_post node-exporter.service
if [ $1 -eq 1 ] ; then
/usr/bin/systemctl preset node-exporter.service ||:
fi
%preun node-exporter
%systemd_preun node-exporter.service
if [ $1 -eq 0 ] ; then
/usr/bin/systemctl --no-reload disable node-exporter.service ||:
/usr/bin/systemctl stop node-exporter.service ||:
fi
%postun node-exporter
/usr/bin/systemctl daemon-reload ||:
%files node-exporter
%defattr(-,root,root)