rhel: Add systemd suport for ovn-controller-vtep.
authorRussell Bryant <rbryant@redhat.com>
Wed, 26 Aug 2015 21:46:54 +0000 (17:46 -0400)
committerBen Pfaff <blp@nicira.com>
Fri, 28 Aug 2015 18:31:13 +0000 (11:31 -0700)
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
rhel/automake.mk
rhel/openvswitch-fedora.spec.in
rhel/usr_lib_systemd_system_ovn-controller-vtep.service [new file with mode: 0644]

index d263325..e484a93 100644 (file)
@@ -28,6 +28,7 @@ EXTRA_DIST += \
        rhel/usr_lib_systemd_system_openvswitch.service \
        rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
        rhel/usr_lib_systemd_system_ovn-controller.service \
+       rhel/usr_lib_systemd_system_ovn-controller-vtep.service \
        rhel/usr_lib_systemd_system_ovn-northd.service
 
 update_rhel_spec = \
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
diff --git a/rhel/usr_lib_systemd_system_ovn-controller-vtep.service b/rhel/usr_lib_systemd_system_ovn-controller-vtep.service
new file mode 100644 (file)
index 0000000..f8ec238
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=OVN VTEP gateway controller daemon
+After=syslog.target
+Requires=openvswitch.service
+After=openvswitch.service
+
+[Service]
+Type=simple
+Environment=OVS_RUNDIR=%t/openvswitch
+ExecStart=/usr/bin/ovn-controller-vtep -vconsole:emer -vsyslog:err -vfile:info \
+          --log-file=/var/log/openvswitch/ovn-controller-vtep.log \
+          --no-chdir --pidfile=${OVS_RUNDIR}/ovn-controller-vtep.pid