Change in vdsm[master]: tool: avoid swallowing errors in seboolsetup calls.

mtayer at redhat.com mtayer at redhat.com
Thu Oct 2 15:38:30 UTC 2014


mooli tayer has uploaded a new change for review.

Change subject: tool: avoid swallowing errors in seboolsetup calls.
......................................................................

tool: avoid swallowing errors in seboolsetup calls.

Previously we avoided failing when vdsm-tool sebool-unconfig or vdsm-tool sebool-unconfig failed.
This was done to cope with rhbz 883355 where disabled selinux might cause inconsistent installations.

This patch suggests to fail installation (standalone and host deploy) when seboolsetup failes.
This is done to cope with cases like bug 1139873 where there is a different unknown failure and still host
deploy succeeds.

To avoid disabled selinux related problems /usr/sbin/selinuxenabled is used.

Change-Id: I8b6d43954347f3aa2ce671131c1917d57d53fddf
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1139873
Signed-off-by: Mooli Tayer <mtayer at redhat.com>
---
M vdsm.spec.in
1 file changed, 11 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/33737/1

diff --git a/vdsm.spec.in b/vdsm.spec.in
index cd1c0e4..dba122b 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -112,6 +112,10 @@
 %endif
 
 %if 0%{?with_systemd}
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+BuildRequires: systemd
 BuildRequires: systemd-units
 %endif
 
@@ -752,7 +756,9 @@
 
 %post
 %{_bindir}/vdsm-tool configure --module sanlock --force >/dev/null
-%{_bindir}/vdsm-tool sebool-config || :
+if /usr/sbin/selinuxenabled; then
+    %{_bindir}/vdsm-tool sebool-config
+fi
 # set the vdsm "secret" password for libvirt
 %{_bindir}/vdsm-tool set-saslpasswd
 
@@ -817,7 +823,9 @@
     /bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
         /etc/sysctl.conf
 
-    %{_bindir}/vdsm-tool sebool-unconfig || :
+    if /usr/sbin/selinuxenabled; then
+        %{_bindir}/vdsm-tool sebool-unconfig
+    fi
 
     %{_bindir}/vdsm-tool remove-saslpasswd
 
@@ -863,8 +871,7 @@
     if ! %{_bindir}/vdsm-tool is-configured --module libvirt >/dev/null 2>&1;
     then
         if ! %{_bindir}/vdsm-tool configure --module libvirt --force \
-                >/dev/null 2>&1; then
-            # fallback to vdsmd reconfigure api - This change may be removed
+s            # fallback to vdsmd reconfigure api - This change may be removed
             # when vdsm won't support any downgrade\upgrade to versions that
             # don't include vdsm-tool configure api (vdsm <= 3.3)
             for f in '/usr/lib/systemd/systemd-vdsmd' '/etc/init.d/vdsmd'; do


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b6d43954347f3aa2ce671131c1917d57d53fddf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer at redhat.com>


More information about the vdsm-patches mailing list