[ovs-dev,v3,2/2] rhel: delete transient ports on boot when starting ovsdb-server

Submitted by Timothy Redaelli on Aug. 11, 2017, 4:06 p.m.

Details

Message ID 8b3784fede9de6d2ab745139c2346410d7eed749.1502466863.git.tredaelli@redhat.com
State New
Headers show

Commit Message

Timothy Redaelli Aug. 11, 2017, 4:06 p.m.
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@redhat.com>
---
 rhel/usr_lib_systemd_system_ovsdb-server.service | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

aaron conole Aug. 11, 2017, 5:12 p.m.
Timothy Redaelli <tredaelli@redhat.com> writes:

> 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@redhat.com>
> ---
>  rhel/usr_lib_systemd_system_ovsdb-server.service | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service
> index 7acd25f78..42473161e 100644
> --- a/rhel/usr_lib_systemd_system_ovsdb-server.service
> +++ b/rhel/usr_lib_systemd_system_ovsdb-server.service
> @@ -10,14 +10,14 @@ Type=forking
>  Restart=on-failure
>  EnvironmentFile=/etc/openvswitch/default.conf
>  EnvironmentFile=-/etc/sysconfig/openvswitch
> +ExecStartPre=/usr/bin/mkdir -p /var/run/openvswitch
>  ExecStartPre=/usr/bin/chown ${OVS_USER_ID} /var/run/openvswitch
>  ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
>            --no-ovs-vswitchd --no-monitor --system-id=random \
> +          --delete-transient-ports-on-boot \
>            --ovs-user=${OVS_USER_ID} \
>            start $OPTIONS
>  ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
>  ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \
>             --ovs-user=${OVS_USER_ID} \
>             --no-monitor restart $OPTIONS
> -RuntimeDirectory=openvswitch
> -RuntimeDirectoryMode=0755

I'm not sure about this change.  One thing that's nice is the way
systemd will cleanup the runtime directories when this is done.  I think
this can leave it around.

I realize that under rhel (and fedora), the /run mountpoint is tmpfs.

Is there another way we could accomodate this?  Does a db flag make
sense?

Patch hide | download patch | download mbox

diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service
index 7acd25f78..42473161e 100644
--- a/rhel/usr_lib_systemd_system_ovsdb-server.service
+++ b/rhel/usr_lib_systemd_system_ovsdb-server.service
@@ -10,14 +10,14 @@  Type=forking
 Restart=on-failure
 EnvironmentFile=/etc/openvswitch/default.conf
 EnvironmentFile=-/etc/sysconfig/openvswitch
+ExecStartPre=/usr/bin/mkdir -p /var/run/openvswitch
 ExecStartPre=/usr/bin/chown ${OVS_USER_ID} /var/run/openvswitch
 ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
           --no-ovs-vswitchd --no-monitor --system-id=random \
+          --delete-transient-ports-on-boot \
           --ovs-user=${OVS_USER_ID} \
           start $OPTIONS
 ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
 ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \
            --ovs-user=${OVS_USER_ID} \
            --no-monitor restart $OPTIONS
-RuntimeDirectory=openvswitch
-RuntimeDirectoryMode=0755