[ovs-dev] [PATCH ovn] RHEL: Suppress systemd status message during pre-installation.

Mark Michelson mmichels at redhat.com
Mon Aug 5 18:15:07 UTC 2019


When running the pre-installation hook, the spec file attempts to
determine if the old openvswitch-provided OVN services are running. If
this is a fresh installation, then there never was an
openvswitch-provided service installed on the machine. Therefore,
systemd will emit a warning saying the service can't be found. There is
nothing that indicates that this message is coming pre-installation, and
so it appears as though something has gone wrong while trying to install
the package.

This commit suppresses stderr when checking the status of the ovn
services pre-installation. This way, if a problem is encountered, it
does not appear that there was an error during installation.

Signed-off-by: Mark Michelson <mmichels at redhat.com>
---
 rhel/ovn-fedora.spec.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
index 2ecc629f2..2234e949f 100644
--- a/rhel/ovn-fedora.spec.in
+++ b/rhel/ovn-fedora.spec.in
@@ -219,7 +219,7 @@ rm -rf $RPM_BUILD_ROOT
 %pre central
 if [ $1 -eq 1 ] ; then
     # Package install.
-    /bin/systemctl status ovn-northd.service >/dev/null
+    /bin/systemctl status ovn-northd.service &>/dev/null
     ovn_status=$?
     rpm -ql openvswitch-ovn-central > /dev/null
     if [[ "$?" = "0" && "$ovn_status" = "0" ]]; then
@@ -233,7 +233,7 @@ fi
 %pre host
 if [ $1 -eq 1 ] ; then
     # Package install.
-    /bin/systemctl status ovn-controller.service >/dev/null
+    /bin/systemctl status ovn-controller.service &>/dev/null
     ovn_status=$?
     rpm -ql openvswitch-ovn-host > /dev/null
     if [[ "$?" = "0" && "$ovn_status" = "0" ]]; then
-- 
2.14.5



More information about the dev mailing list