diff options
| author | Aravinda VK <avishwan@redhat.com> | 2016-10-18 14:57:47 +0530 | 
|---|---|---|
| committer | Aravinda VK <avishwan@redhat.com> | 2016-10-24 04:06:02 -0700 | 
| commit | abcccd602b05e4f7900073b067987c24b49c3a77 (patch) | |
| tree | 453bd1527a8371308eea09ec592e51de52f1e1e1 | |
| parent | 3f09391c9b97f1332b0585fa553b019cf871f4a0 (diff) | |
eventsapi/packaging: Fix wrong usage of %post
%postun was used for events package instead of %post. eventsd
service should be restarted only after install/upgrade and not
during uninstallation(%postun)
> Reviewed-on: http://review.gluster.org/15670
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Niels de Vos <ndevos@redhat.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
(cherry picked from commit ee4c768dafda992ab6bf3787b4efc8b0f330623e)
BUG: 1387492
Change-Id: Iae3eab06d02c5f4134b3de09f040123bed053bb8
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/15693
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | glusterfs.spec.in | 25 | 
2 files changed, 20 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore index 45400ac449d..7c32e956453 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,5 @@ events/src/eventsapiconf.py  extras/systemd/glustereventsd.service  events/src/eventtypes.py  libglusterfs/src/eventtypes.h +extras/init.d/glustereventsd-FreeBSD +extras/init.d/glustereventsd-Redhat diff --git a/glusterfs.spec.in b/glusterfs.spec.in index 10dd67eabd7..e42dfb97d0f 100644 --- a/glusterfs.spec.in +++ b/glusterfs.spec.in @@ -111,6 +111,7 @@  # can't seem to make a generic macro that works  %global _init_glusterd   %{_unitdir}/glusterd.service  %global _init_glusterfsd %{_unitdir}/glusterfsd.service +%global _init_glustereventsd %{_unitdir}/glustereventsd.service  %else  %global _init_enable()  /sbin/chkconfig --add %1 ;  %global _init_disable() /sbin/chkconfig --del %1 ; @@ -121,6 +122,7 @@  # can't seem to make a generic macro that works  %global _init_glusterd   %{_sysconfdir}/init.d/glusterd  %global _init_glusterfsd %{_sysconfdir}/init.d/glusterfsd +%global _init_glustereventsd %{_sysconfdir}/init.d/glustereventsd  %endif  %if ( 0%{_for_fedora_koji_builds} ) @@ -765,6 +767,11 @@ exit 0  %post api  /sbin/ldconfig +%if ( 0%{!?_without_events:1} ) +%post events +%_init_restart glustereventsd +%endif +  %if ( 0%{?rhel} == 5 )  %post fuse  modprobe fuse @@ -861,6 +868,17 @@ exit 0  ##-----------------------------------------------------------------------------  ## All %%preun should be placed here and keep them sorted  ## +%if ( 0%{!?_without_events:1} ) +%preun events +if [ $1 -eq 0 ]; then +    if [ -f %_init_glustereventsd ]; then +        %_init_stop glustereventsd +        %_init_disable glustereventsd +    fi +fi +exit 0 +%endif +  %preun server  if [ $1 -eq 0 ]; then      if [ -f %_init_glusterfsd ]; then @@ -894,13 +912,6 @@ exit 0  %postun api  /sbin/ldconfig -%postun events -%if ( 0%{!?_without_events:1} ) -%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 6 ) -%_init_restart glustereventsd -%endif -%endif -  %postun libs  /sbin/ldconfig  | 
