From f1436672d946c9b45520dfeaac99691777c4335c Mon Sep 17 00:00:00 2001
From: Eric Cano <Eric.Cano@cern.ch>
Date: Mon, 5 Mar 2018 10:49:27 +0100
Subject: [PATCH] Added explicit systemctl daemon-reload to post (un) install
 scripts of rpms.

The systemd support macro for rpm did not include this support.
---
 cta.spec.in | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cta.spec.in b/cta.spec.in
index d25b4a7f0f..8f18ab0cf4 100644
--- a/cta.spec.in
+++ b/cta.spec.in
@@ -16,6 +16,10 @@
 #-------------------------------------
 %define skip_unit_tests @SKIP_UNIT_TESTS@
 
+# Utility for reloading systemctl when needed
+#--------------------------------------------
+%define systemdDaemonReload() if [ -e /usr/bin/systemctl ] ; then /usr/bin/systemctl daemon-reload; fi
+
 # General settings
 #-----------------
 Summary: CERN Tape Archive
@@ -122,12 +126,14 @@ The tape server daemon
 
 %post -n cta-taped
 %systemd_post cta-taped.service
+%systemdDaemonReload
 
 %preun -n cta-taped
 %systemd_preun cta-taped.service
 
 %postun -n cta-taped
 %systemd_postun cta-taped.service
+%systemdDaemonReload
 
 %package -n cta-frontend
 Summary: CERN Tape Archive: Xrootd plugin
@@ -155,6 +161,7 @@ The xroot plugin
 %post -n cta-frontend
 /sbin/ldconfig
 %systemd_post cta-frontend.service
+%systemdDaemonReload
 
 %preun -n cta-frontend
 %systemd_preun cta-frontend.service
@@ -162,6 +169,7 @@ The xroot plugin
 %postun -n cta-frontend
 /sbin/ldconfig
 %systemd_post cta-frontend.service
+%systemdDaemonReload
 
 %package -n cta-cli
 Summary: CERN Tape Archive: command line interface
@@ -313,12 +321,14 @@ Tools to faciliate working with rmcd and smc in cta
 
 %post -n cta-rmcd
 %systemd_post cta-rmcd.service
+%systemdDaemonReload
 
 %preun -n cta-rmcd
 %systemd_preun cta-rmcd.service
 
 %postun -n cta-rmcd
 %systemd_postun cta-rmcd.service
+%systemdDaemonReload
 
 %package -n cta-tape-developer-acs-tools
 Summary: Cern Advanced mass STORage
-- 
GitLab