rhel: Add systemd suport for ovn-controller-vtep.
[cascardo/ovs.git] / rhel / openvswitch-fedora.spec.in
index 4789704..695f1d7 100644 (file)
@@ -116,7 +116,8 @@ install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
 install -p -D -m 0644 \
         rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
         $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
-for service in openvswitch openvswitch-nonetwork ovn-controller ovn-northd; do
+for service in openvswitch openvswitch-nonetwork \
+               ovn-controller ovn-controller-vtep ovn-northd; do
        install -p -D -m 0644 \
                        rhel/usr_lib_systemd_system_${service}.service \
                        $RPM_BUILD_ROOT%{_unitdir}/${service}.service
@@ -173,12 +174,15 @@ rm -rf $RPM_BUILD_ROOT
 %preun ovn
 %if 0%{?systemd_preun:1}
     %systemd_preun ovn-controller.service
+    %systemd_preun ovn-controller-vtep.service
     %systemd_preun ovn-northd.service
 %else
     if [ $1 -eq 0 ] ; then
     # Package removal, not upgrade
         /bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
         /bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
+        /bin/systemctl --no-reload disable ovn-controller-vtep.service >/dev/null 2>&1 || :
+        /bin/systemctl stop ovn-controller-vtep.service >/dev/null 2>&1 || :
         /bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
         /bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
     fi
@@ -197,6 +201,7 @@ rm -rf $RPM_BUILD_ROOT
 %post ovn
 %if 0%{?systemd_post:1}
     %systemd_post ovn-controller.service
+    %systemd_post ovn-controller-vtep.service
     %systemd_post ovn-northd.service
 %else
     # Package install, not upgrade
@@ -219,12 +224,14 @@ rm -rf $RPM_BUILD_ROOT
 %postun ovn
 %if 0%{?systemd_postun_with_restart:1}
     %systemd_postun_with_restart ovn-controller.service
+    %systemd_postun_with_restart ovn-controller-vtep.service
     %systemd_postun_with_restart ovn-northd.service
 %else
     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     if [ "$1" -ge "1" ] ; then
     # Package upgrade, not uninstall
         /bin/systemctl try-restart ovn-controller.service >/dev/null 2>&1 || :
+        /bin/systemctl try-restart ovn-controller-vtep.service >/dev/null 2>&1 || :
         /bin/systemctl try-restart ovn-northd.service >/dev/null 2>&1 || :
     fi
 %endif
@@ -341,6 +348,7 @@ rm -rf $RPM_BUILD_ROOT
 %config %{_datadir}/openvswitch/ovn-nb.ovsschema
 %config %{_datadir}/openvswitch/ovn-sb.ovsschema
 %{_unitdir}/ovn-controller.service
+%{_unitdir}/ovn-controller-vtep.service
 %{_unitdir}/ovn-northd.service
 
 %changelog