openvswitch: Stop using intermediate scripts

This will fix exit codes - details in bug.

Basically openvswitch treats TERM as something fatal (exits
with 143) and the only solution for graceful exit is using
ovs-appctl and sending exit command, just like ovs-ctl utility
does.

Depends-On: https://review.opendev.org/c/openstack/kolla/+/905189

Partial-Bug: #2048130
Change-Id: I523018cb98944de60d7b95404deb7cebd641f33a
This commit is contained in:
Michal Nasiadka 2024-01-09 14:16:45 +01:00
parent 4f031961a3
commit 5aac09c9a2
5 changed files with 4 additions and 59 deletions

View File

@ -25,34 +25,6 @@
notify:
- "Restart {{ item.key }} container"
- name: Copying over start-ovs file for openvswitch-vswitchd
become: true
vars:
service: "{{ openvswitch_services['openvswitch-vswitchd'] }}"
template:
src: "{{ role_path }}/templates/start-ovs.j2"
dest: "{{ node_config_directory }}/openvswitch-vswitchd/start-ovs"
mode: "0770"
when:
- service.host_in_groups | bool
- service.enabled | bool
notify:
- "Restart openvswitch-vswitchd container"
- name: Copying over start-ovsdb-server files for openvswitch-db-server
become: true
vars:
service: "{{ openvswitch_services['openvswitch-db-server'] }}"
template:
src: "{{ role_path }}/templates/start-ovsdb-server.j2"
dest: "{{ node_config_directory }}/openvswitch-db-server/start-ovsdb-server"
mode: "0770"
when:
- service.host_in_groups | bool
- service.enabled | bool
notify:
- "Restart openvswitch-db-server container"
- name: Copying over ovs-vsctl wrapper
vars:
service: "{{ openvswitch_services['openvswitch-vswitchd'] }}"

View File

@ -1,11 +1,4 @@
{
"command": "start-ovsdb-server 127.0.0.1",
"config_files": [
{
"source": "{{ container_config_directory }}/start-ovsdb-server",
"dest": "/usr/local/bin/start-ovsdb-server",
"owner": "root",
"perm": "0655"
}
]
"command": "ovs_wrapper ovsdb-server /var/lib/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --remote=ptcp:{{ ovsdb_port }}:127.0.0.1 --remote=db:Open_vSwitch,Open_vSwitch,manager_options --log-file=/var/log/kolla/openvswitch/ovsdb-server.log --pidfile",
"config_files": []
}

View File

@ -1,11 +1,4 @@
{
"command": "start-ovs",
"config_files": [
{
"source": "{{ container_config_directory }}/start-ovs",
"dest": "/usr/local/bin/start-ovs",
"owner": "root",
"perm": "0655"
}
]
"command": "ovs_wrapper ovs-vswitchd unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file=/var/log/kolla/openvswitch/ovs-vswitchd.log --pidfile",
"config_files": []
}

View File

@ -1,2 +0,0 @@
#!/usr/bin/env bash
/usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file=/var/log/kolla/openvswitch/ovs-vswitchd.log --pidfile

View File

@ -1,11 +0,0 @@
#!/bin/bash
# NOTE(mnasiadka): ensure existing ovsdb doesn't need to be upgraded
if ([ -f /var/lib/openvswitch/conf.db ] && [ `ovsdb-tool needs-conversion /var/lib/openvswitch/conf.db` == "yes" ]); then
/usr/bin/ovsdb-tool convert /var/lib/openvswitch/conf.db
fi
ovsdb_ip=$1
/usr/sbin/ovsdb-server /var/lib/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --remote=ptcp:{{ ovsdb_port }}:$ovsdb_ip --remote=db:Open_vSwitch,Open_vSwitch,manager_options --log-file=/var/log/kolla/openvswitch/ovsdb-server.log --pidfile