[ovs-dev] [PATCH 2/2] rhel: delete transient ports on boot when starting ovsdb-server
Timothy Redaelli
tredaelli at redhat.com
Fri May 5 18:34:14 UTC 2017
Use ovs-ctl --delete-transient-ports-on-boot to start ovsdb-server.
This feature can be disabled by appending --no-delete-transient-ports-on-boot
to OPTIONS in /etc/sysconfig/openvswitch
Signed-off-by: Timothy Redaelli <tredaelli at redhat.com>
---
rhel/automake.mk | 1 +
rhel/openvswitch-fedora.spec.in | 6 +++++-
rhel/usr_lib_systemd_system_ovsdb-server.service | 3 +--
rhel/usr_lib_tmpfiles.d_openvswitch.conf | 1 +
4 files changed, 8 insertions(+), 3 deletions(-)
create mode 100644 rhel/usr_lib_tmpfiles.d_openvswitch.conf
diff --git a/rhel/automake.mk b/rhel/automake.mk
index 1265fa74..cc24a0bc 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -31,6 +31,7 @@ EXTRA_DIST += \
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 \
+ rhel/usr_lib_tmpfiles.d_openvswitch.conf \
rhel/usr_lib_firewalld_services_ovn-central-firewall-service.xml \
rhel/usr_lib_firewalld_services_ovn-host-firewall-service.xml
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 3200040e..3352bde7 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -246,6 +246,9 @@ done
install -m 0755 rhel/etc_init.d_openvswitch \
$RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
+install -p -D -m 0644 rhel/usr_lib_tmpfiles.d_openvswitch.conf \
+ $RPM_BUILD_ROOT%{_tmpfilesdir}/openvswitch.conf
+
install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
$RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
@@ -488,6 +491,7 @@ fi
%{_unitdir}/ovsdb-server.service
%{_unitdir}/ovs-vswitchd.service
%{_datadir}/openvswitch/scripts/openvswitch.init
+%{_tmpfilesdir}/openvswitch.conf
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
%{_datadir}/openvswitch/bugtool-plugins/
@@ -534,7 +538,7 @@ fi
%doc COPYING NOTICE README.rst NEWS rhel/README.RHEL.rst
/var/lib/openvswitch
/var/log/openvswitch
-%ghost %attr(755,root,root) %{_rundir}/openvswitch
+%dir %{_rundir}/openvswitch
%files ovn-docker
%{_bindir}/ovn-docker-overlay-driver
diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service
index 68deace7..d3c3e4ad 100644
--- a/rhel/usr_lib_systemd_system_ovsdb-server.service
+++ b/rhel/usr_lib_systemd_system_ovsdb-server.service
@@ -11,9 +11,8 @@ Restart=on-failure
EnvironmentFile=-/etc/sysconfig/openvswitch
ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
--no-ovs-vswitchd --no-monitor --system-id=random \
+ --delete-transient-ports-on-boot \
start $OPTIONS
ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \
--no-monitor restart $OPTIONS
-RuntimeDirectory=openvswitch
-RuntimeDirectoryMode=0755
diff --git a/rhel/usr_lib_tmpfiles.d_openvswitch.conf b/rhel/usr_lib_tmpfiles.d_openvswitch.conf
new file mode 100644
index 00000000..b1519dd7
--- /dev/null
+++ b/rhel/usr_lib_tmpfiles.d_openvswitch.conf
@@ -0,0 +1 @@
+d /var/run/openvswitch 755 root root
--
2.12.2
More information about the dev
mailing list