[ovs-dev,ovn] RHEL: Suppress systemd status message during pre-installation.
diff mbox series

Message ID 20190805181507.30536-1-mmichels@redhat.com
State New
Headers show
Series
  • [ovs-dev,ovn] RHEL: Suppress systemd status message during pre-installation.
Related show

Commit Message

Mark Michelson Aug. 5, 2019, 6:15 p.m. UTC
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@redhat.com>
---
 rhel/ovn-fedora.spec.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Numan Siddique Aug. 5, 2019, 7:37 p.m. UTC | #1
On Mon, Aug 5, 2019 at 11:45 PM Mark Michelson <mmichels@redhat.com> wrote:

> 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@redhat.com>
>

Acked-by: Numan Siddique <nusiddiq@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
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Mark Michelson Aug. 6, 2019, 2:51 p.m. UTC | #2
Thanks, I applied this to master.

On 8/5/19 3:37 PM, Numan Siddique wrote:
> 
> 
> On Mon, Aug 5, 2019 at 11:45 PM Mark Michelson <mmichels@redhat.com 
> <mailto:mmichels@redhat.com>> wrote:
> 
>     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@redhat.com
>     <mailto:mmichels@redhat.com>>
> 
> 
> Acked-by: Numan Siddique <nusiddiq@redhat.com <mailto:nusiddiq@redhat.com>>
> 
>     ---
>       rhel/ovn-fedora.spec.in <http://ovn-fedora.spec.in> | 4 ++--
>       1 file changed, 2 insertions(+), 2 deletions(-)
> 
>     diff --git a/rhel/ovn-fedora.spec.in <http://ovn-fedora.spec.in>
>     b/rhel/ovn-fedora.spec.in <http://ovn-fedora.spec.in>
>     index 2ecc629f2..2234e949f 100644
>     --- a/rhel/ovn-fedora.spec.in <http://ovn-fedora.spec.in>
>     +++ b/rhel/ovn-fedora.spec.in <http://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
> 
>     _______________________________________________
>     dev mailing list
>     dev@openvswitch.org <mailto:dev@openvswitch.org>
>     https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>

Patch
diff mbox series

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