diff --git a/ovn.spec b/ovn.spec index 357da562de127f226b9b1c7c3feeddb1e8121fd7..ba56b10d547b01bdbd8bd5005a27da1479fc3a12 100644 --- a/ovn.spec +++ b/ovn.spec @@ -4,7 +4,7 @@ Name: ovn Version: %{ovn_version} -Release: 1 +Release: 2 Summary: Open Virtual Network support URL: https://www.ovn.org/ Source0: https://github.com/ovn-org/ovn/archive/refs/tags/v%{ovn_version}.tar.gz#/ovn-%{version}.tar.gz @@ -167,39 +167,45 @@ fi %pre central if [ $1 -eq 1 ] ; then # Package install. - /bin/systemctl status ovn-northd.service >/dev/null - ovn_status=$? - if [[ "$ovn_status" = "0" ]]; then - # ovn-northd service is running which means old openvswitch-ovn-central - # is possibly installed and it will be cleaned up. So start ovn-northd - # service when posttrans central is called. - touch %{_localstatedir}/lib/rpm-state/ovn-northd + if [ -e %{_unitdir}/ovn-northd.service ]; then + /bin/systemctl status ovn-northd.service >/dev/null + ovn_status=$? + if [[ "$ovn_status" = "0" ]]; then + # ovn-northd service is running which means old openvswitch-ovn-central + # is possibly installed and it will be cleaned up. So start ovn-northd + # service when posttrans central is called. + touch %{_localstatedir}/lib/rpm-state/ovn-northd + fi fi fi %pre host if [ $1 -eq 1 ] ; then # Package install. - /bin/systemctl status ovn-controller.service >/dev/null - ovn_status=$? - if [[ "$ovn_status" = "0" ]]; then - # ovn-controller service is running which means old - # openvswitch-ovn-host is possibly installed and it will be cleaned up. So - # start ovn-controller service when posttrans host is called. - touch %{_localstatedir}/lib/rpm-state/ovn-controller + if [ -e %{_unitdir}/ovn-controller.service ]; then + /bin/systemctl status ovn-controller.service >/dev/null + ovn_status=$? + if [[ "$ovn_status" = "0" ]]; then + # ovn-controller service is running which means old + # openvswitch-ovn-host is possibly installed and it will be cleaned up. So + # start ovn-controller service when posttrans host is called. + touch %{_localstatedir}/lib/rpm-state/ovn-controller + fi fi fi %pre vtep if [ $1 -eq 1 ] ; then # Package install. - /bin/systemctl status ovn-controller-vtep.service >/dev/null - ovn_status=$? - if [[ "$ovn_status" = "0" ]]; then - # ovn-controller-vtep service is running which means old - # openvswitch-ovn-vtep is possibly installed and it will be cleaned up. So - # start ovn-controller-vtep service when posttrans host is called. - touch %{_localstatedir}/lib/rpm-state/ovn-controller-vtep + if [ -e %{_unitdir}/ovn-vtep.service ]; then + /bin/systemctl status ovn-controller-vtep.service >/dev/null + ovn_status=$? + if [[ "$ovn_status" = "0" ]]; then + # ovn-controller-vtep service is running which means old + # openvswitch-ovn-vtep is possibly installed and it will be cleaned up. So + # start ovn-controller-vtep service when posttrans host is called. + touch %{_localstatedir}/lib/rpm-state/ovn-controller-vtep + fi fi fi @@ -316,6 +322,9 @@ fi %{_unitdir}/ovn-controller-vtep.service %changelog +* Wed May 31 2023 Han Guangyu - 20.06.3-2 +- Fix redundant message during package installation + * Tue Nov 29 2022 Han Guangyu - 20.06.3-1 - Init package