Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: spec: start/enable glusterd
......................................................................

spec: start/enable glusterd

This patch will enable/disable glusterd service after install/remove
of ovirt-node-plugin-vdsm

Change-Id: Ica02b068914a8ae9aaf8c452175db969badc4e6e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1073531
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
---
M ovirt-node-plugin-vdsm.spec.in
1 file changed, 37 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node-plugin-vdsm 
refs/changes/03/26203/1

diff --git a/ovirt-node-plugin-vdsm.spec.in b/ovirt-node-plugin-vdsm.spec.in
index 8e81339..509d280 100644
--- a/ovirt-node-plugin-vdsm.spec.in
+++ b/ovirt-node-plugin-vdsm.spec.in
@@ -1,5 +1,13 @@
 %define is_f19 %(test "0%{?fedora}" -eq "019" && echo 1 || echo 0)
 
+%if 0%{?fedora} >= 18 || 0%{?rhel} >= 6
+%global with_gluster 1
+%endif
+
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%global with_systemd 1
+%endif
+
 Summary:        A plugin to make oVirt Node installs compatible with oVirt 
Engine and vdsm
 Name:           ovirt-node-plugin-vdsm
 Version:        @VERSION@
@@ -22,6 +30,10 @@
 
 BuildArch:      noarch
 BuildRequires:  python2-devel
+
+%if 0%{?with_gluster}
+Requires: glusterfs-server
+%endif
 
 %define app_root %{_datadir}/%{name}
 %define recipe_root %{_datadir}/ovirt-node-recipe
@@ -50,6 +62,17 @@
 make install DESTDIR=%{buildroot}
 
 %post
+if [ $1 -eq 1 ]; then
+%if 0%{?with_gluster}
+%if ! 0%{?with_systemd}
+    service glusterd start >/dev/null 2>&1 || :
+    chkconfig --add glusterd >/dev/null 2>&1 || :
+%else
+    systemctl start glusterd.service >/dev/null 2>&1 || :
+    systemctl enable glusterd.service >/dev/null 2>&1 || :
+%endif
+%endif
+
 # semanage is not present in the image and virt_use_nfs is on (see rhbz#642209)
 # remove it from vdsmd startup script to avoid error
 sed -i 's#/usr/sbin/semanage#/bin/true#' /etc/rc.d/init.d/vdsmd
@@ -65,7 +88,7 @@
 set /files/etc/sysctl.conf/net.ipv4.ip_local_reserved_ports 54321
 save
 EOF_sysctl
-
+fi
 #SELinux Booleans
 /usr/sbin/setsebool -P virt_use_nfs=1 \
                        virt_use_sanlock=1 \
@@ -78,6 +101,19 @@
 
 %preun
 
+%postun
+if [ $1 -eq 0 ]; then
+%if 0%{?with_gluster}
+%if ! 0%{?with_systemd}
+    service glusterd stop >/dev/null 2>&1 || :
+    chkconfig --del glusterd >/dev/null 2>&1 || :
+%else
+    systemctl stop glusterd.service >/dev/null 2>&1 || :
+    systemctl disable glusterd.service >/dev/null 2>&1 || :
+%endif
+%endif
+fi
+
 %files recipe
 %{recipe_root}
 


-- 
To view, visit http://gerrit.ovirt.org/26203
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica02b068914a8ae9aaf8c452175db969badc4e6e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node-plugin-vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to