summaryrefslogtreecommitdiff
path: root/devstack/lib
diff options
context:
space:
mode:
authorBence Romsics <bence.romsics@gmail.com>2020-01-16 18:21:10 +0100
committerBence Romsics <bence.romsics@gmail.com>2020-01-20 10:59:45 +0100
commit426afcfe024249a7e3df551e5512b2da10410282 (patch)
tree361ea14e31b710ce08caa7875695fae7dec6a2e0 /devstack/lib
parent48ab58b46efa53d0ea0e94ebe67f0f1699949bd8 (diff)
downloadneutron-426afcfe024249a7e3df551e5512b2da10410282.tar.gz
[OVN] Use STACK_USER's actual primary group in starting services
devstack/lib/ovn_agent previously hardcoded the expectation that there is a group with the same name as $STACK_USER. This group exists in a default Ubuntu installation, but not in all possible systems. This change starts all services previously using this group under $STACK_USER's actual primary group. Change-Id: I2015157e07f8284199cd4926d7d83bc1bb637339
Diffstat (limited to 'devstack/lib')
-rw-r--r--devstack/lib/ovn_agent14
1 files changed, 8 insertions, 6 deletions
diff --git a/devstack/lib/ovn_agent b/devstack/lib/ovn_agent
index 56a6f3ef22..62f233dbbf 100644
--- a/devstack/lib/ovn_agent
+++ b/devstack/lib/ovn_agent
@@ -96,6 +96,8 @@ OVN_RUNDIR=$OVS_PREFIX/var/run/ovn
NEUTRON_OVN_BIN_DIR=$(get_python_exec_prefix)
NEUTRON_OVN_METADATA_BINARY="neutron-ovn-metadata-agent"
+STACK_GROUP="$( id --group --name "$STACK_USER" )"
+
# Libs from source
# ----------------
@@ -606,7 +608,7 @@ function _start_ovs {
ovs-vsctl --no-wait set bridge br-int fail-mode=secure other-config:disable-in-band=true
local ovscmd="$OVS_SBINDIR/ovs-vswitchd --log-file --pidfile --detach"
- _run_process ovs-vswitchd "$ovscmd" "" "$STACK_USER" "root"
+ _run_process ovs-vswitchd "$ovscmd" "" "$STACK_GROUP" "root"
if is_provider_network || [[ $Q_USE_PROVIDERNET_FOR_PUBLIC == "True" ]]; then
ovn_base_setup_bridge $OVS_PHYSICAL_BRIDGE
@@ -620,7 +622,7 @@ function _start_ovs {
enable_service ovs-vtep
local vtepcmd="$OVS_SCRIPTDIR/ovs-vtep --log-file --pidfile --detach br-v"
- _run_process ovs-vtep "$vtepcmd" "" "$STACK_USER" "root"
+ _run_process ovs-vtep "$vtepcmd" "" "$STACK_GROUP" "root"
vtep-ctl set-manager tcp:$HOST_IP:6640
fi
@@ -676,13 +678,13 @@ function start_ovn {
local cmd="/bin/bash $SCRIPTDIR/ovn-ctl --no-monitor start_controller"
local stop_cmd="/bin/bash $SCRIPTDIR/ovn-ctl stop_controller"
- _run_process ovn-controller "$cmd" "$stop_cmd" "$STACK_USER" "root"
+ _run_process ovn-controller "$cmd" "$stop_cmd" "$STACK_GROUP" "root"
fi
if is_service_enabled ovn-controller-vtep ; then
local cmd="$OVS_BINDIR/ovn-controller-vtep --log-file --pidfile --detach --ovnsb-db=$OVN_SB_REMOTE"
- _run_process ovn-controller-vtep "$cmd" "" "$STACK_USER" "root"
+ _run_process ovn-controller-vtep "$cmd" "" "$STACK_GROUP" "root"
fi
if is_service_enabled neutron-ovn-metadata-agent; then
@@ -694,11 +696,11 @@ function start_ovn {
if is_service_enabled br-ex-tcpdump ; then
# tcpdump monitor on br-ex for ARP, reverse ARP and ICMP v4 / v6 packets
sudo ip link set dev $PUBLIC_BRIDGE up
- run_process br-ex-tcpdump "/usr/sbin/tcpdump -i $PUBLIC_BRIDGE arp or rarp or icmp or icmp6 -enlX" $STACK_USER root
+ run_process br-ex-tcpdump "/usr/sbin/tcpdump -i $PUBLIC_BRIDGE arp or rarp or icmp or icmp6 -enlX" "$STACK_GROUP" root
fi
if is_service_enabled br-int-flows ; then
- run_process br-int-flows "/bin/sh -c \"set +e; while true; do echo ovs-ofctl dump-flows br-int; ovs-ofctl dump-flows br-int ; sleep 30; done; \"" $STACK_USER root
+ run_process br-int-flows "/bin/sh -c \"set +e; while true; do echo ovs-ofctl dump-flows br-int; ovs-ofctl dump-flows br-int ; sleep 30; done; \"" "$STACK_GROUP" root
fi
# NOTE(lucasagomes): To keep things simpler, let's reuse the same