diff options
author | Bala.FA <barumuga@redhat.com> | 2014-06-19 14:52:04 +0530 |
---|---|---|
committer | Bala FA <barumuga@redhat.com> | 2014-06-20 03:09:03 -0700 |
commit | 292b1c51bb7a93d0f3218ab3c7c5286bc095a7d9 (patch) | |
tree | 772bd24c3e4d9dc4baca0b323f4b27af0786c970 | |
parent | 66cc1bb198024faf534f51c64ed077c61a4ed433 (diff) |
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 <barumuga@redhat.com>
Reviewed-on: http://review.gluster.org/8112
Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
-rw-r--r-- | gluster-nagios-addons.spec.in | 13 |
1 files 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 |