]> git.proxmox.com Git - mirror_ovs.git/blobdiff - rhel/openvswitch-fedora.spec.in
fedora: Handle upgrades from rhel package.
[mirror_ovs.git] / rhel / openvswitch-fedora.spec.in
index e8165f973f1ce52de5b616d2be88d0986087e27e..d41d11cc4f54dbf944150042a22a808baa08b9a3 100644 (file)
@@ -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