From 292b1c51bb7a93d0f3218ab3c7c5286bc095a7d9 Mon Sep 17 00:00:00 2001 From: "Bala.FA" Date: Thu, 19 Jun 2014 14:52:04 +0530 Subject: rpm: fix service restart on post Currently iptables and other services are restarted without checking current state. This patch fixes this issue by doing conditional restart. Change-Id: I6149af00aae7ba7acda9e0f5f6295b9f78363631 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1110719 Signed-off-by: Bala.FA Reviewed-on: http://review.gluster.org/8112 Reviewed-by: Shubhendu Tripathi Reviewed-by: Humble Devassy Chirammal --- gluster-nagios-addons.spec.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gluster-nagios-addons.spec.in b/gluster-nagios-addons.spec.in index 885a641..58f625c 100644 --- a/gluster-nagios-addons.spec.in +++ b/gluster-nagios-addons.spec.in @@ -129,7 +129,10 @@ rm -rf %{buildroot} %else /sbin/iptables -I INPUT 1 -p tcp --dport 5666 -j ACCEPT /sbin/service iptables save -%_init_restart iptables +if [ "$1" -eq 2 ]; then + # called at rpm upgrade + %_init_try_restart iptables +fi %endif if grep -q "dont_blame_nrpe=0" %{_sysconfdir}/nagios/nrpe.cfg ; then @@ -157,11 +160,13 @@ command[discoverhostparams]=sudo %{_libdir}/nagios/plugins/gluster/discoverhostp command[configure_gluster_node]=sudo %{_libdir}/nagios/plugins/gluster/configure_gluster_node.py -c \$ARG1\$ -n \$ARG2\$ -H \$ARG3\$ %{_end_conf_section} EOF + %_init_enable nrpe %_init_enable glusterpmd -%_init_restart crond -%_init_restart rsyslog -%_init_restart glusterpmd + +%_init_try_restart crond +%_init_try_restart rsyslog +%_init_try_restart glusterpmd %preun if [ "$1" -eq 0 ]; then -- cgit