From 8c6710326eaf8114b579720185161091a0a9f38c Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 9 Feb 2022 18:01:46 +0000 Subject: [PATCH] Fix installation with OVN backend and compilation This patch fixes several issues related to the installation with OVN backend with the OVS/OVN compilation enabled. The OVS/OVN local directories prefix, when both services are compiled, is now "/usr/local". The "ovn_agent._run_process" function is calling "ovs-appctl" to configure the logging settings of several services. Instead of using the service name, the ctl socket file is used instead. That is more robust and does not fail in systems with previous installations. Closes-Bug: #1960514 Change-Id: I69de5333393957593db6e05495f0c3c758efefdf --- lib/neutron_plugins/ovn_agent | 7 ++++++- lib/neutron_plugins/ovs_base | 2 +- lib/neutron_plugins/ovs_source | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/neutron_plugins/ovn_agent b/lib/neutron_plugins/ovn_agent index 09b28b6c3f..927896b70b 100644 --- a/lib/neutron_plugins/ovn_agent +++ b/lib/neutron_plugins/ovn_agent @@ -253,7 +253,12 @@ function _run_process { local testcmd="test -e $OVS_RUNDIR/$service.pid" test_with_retry "$testcmd" "$service did not start" $SERVICE_TIMEOUT 1 - sudo ovs-appctl -t $service vlog/set console:off syslog:info file:info + local service_ctl_file + service_ctl_file=$(ls $OVS_RUNDIR | grep $service | grep ctl) + if [ -z "$service_ctl_file" ]; then + die $LINENO "ctl file for service $service is not present." + fi + sudo ovs-appctl -t $OVS_RUNDIR/$service_ctl_file vlog/set console:off syslog:info file:info } function clone_repository { diff --git a/lib/neutron_plugins/ovs_base b/lib/neutron_plugins/ovs_base index 8acf586189..cc41a8cd46 100644 --- a/lib/neutron_plugins/ovs_base +++ b/lib/neutron_plugins/ovs_base @@ -68,7 +68,7 @@ function _neutron_ovs_base_install_ubuntu_dkms { function _neutron_ovs_base_install_agent_packages { if [ "$Q_BUILD_OVS_FROM_GIT" == "True" ]; then remove_ovs_packages - compile_ovs False /usr /var + compile_ovs False /usr/local /var load_conntrack_gre_module start_new_ovs else diff --git a/lib/neutron_plugins/ovs_source b/lib/neutron_plugins/ovs_source index 9c87dce551..9ae5555afb 100644 --- a/lib/neutron_plugins/ovs_source +++ b/lib/neutron_plugins/ovs_source @@ -188,12 +188,12 @@ function action_openvswitch { # start_new_ovs() - removes old ovs database, creates a new one and starts ovs function start_new_ovs { sudo rm -f /etc/openvswitch/conf.db /etc/openvswitch/.conf.db~lock~ - sudo /usr/share/openvswitch/scripts/ovs-ctl start + sudo /usr/local/share/openvswitch/scripts/ovs-ctl start } # stop_new_ovs() - stops ovs function stop_new_ovs { - local ovs_ctl='/usr/share/openvswitch/scripts/ovs-ctl' + local ovs_ctl='/usr/local/share/openvswitch/scripts/ovs-ctl' if [ -x $ovs_ctl ] ; then sudo $ovs_ctl stop