summaryrefslogtreecommitdiff
path: root/rhel
diff options
context:
space:
mode:
authorGurucharan Shetty <guru@ovn.org>2019-05-02 23:50:12 -0700
committerGurucharan Shetty <guru@ovn.org>2019-05-14 01:03:35 -0700
commitdab29add2db5f8f43ffe0dc17a4bb8f91b9a0ae3 (patch)
tree6b6035d966b136500068772dcaa65136dd125544 /rhel
parentdcd0f1e8779c6623188f1a36753242e27db06cbb (diff)
downloadopenvswitch-dab29add2db5f8f43ffe0dc17a4bb8f91b9a0ae3.tar.gz
fedora: Handle upgrades from rhel package.
Currently we have rhel/openvswitch.spec.in that provides sysv scripts. The fedora package provides systemd scripts. If one upgrades openvswitch package from sysv to systemd, you will end up in a situation where old OVS daemons are running, but systemd does not know about it. One "restart" is needed for systemd to see the old daemons. Another "restart" or "force-reload-kmod" is needed to actually use the new daemons. This commit, just takes care of the first restart. The "real" restart/force-reload-kmod will still have to be done outside the package installation. Signed-off-by: Gurucharan Shetty <guru@ovn.org> Acked-by: Ansis Atteka <aatteka@ovn.org>
Diffstat (limited to 'rhel')
-rw-r--r--rhel/openvswitch-fedora.spec.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index e8165f973..d41d11cc4 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -364,6 +364,12 @@ getent passwd openvswitch >/dev/null || \
usermod -a -G hugetlbfs openvswitch
%endif
%endif
+
+%if %{with autoenable}
+ if [ -x "/etc/init.d/openvswitch" ]; then
+ touch %{_tmppath}/ovs-upgrade-from-sysv
+ fi
+%endif
exit 0
%post
@@ -397,6 +403,14 @@ fi
%if %{with autoenable}
systemctl daemon-reload
systemctl enable openvswitch
+ # Handle upgrades to this package from the OVS repo's rhel packages.
+ # One "restart" is needed for newer systemd files to see the old running
+ # daemons. Another "restart" (outside the package postinst script) is
+ # needed to actually run new daemons.
+ if [ -e "%{_tmppath}/ovs-upgrade-from-sysv" ]; then
+ systemctl restart openvswitch
+ rm "%{_tmppath}/ovs-upgrade-from-sysv"
+ fi
%endif
%post selinux-policy