Commit 6ff72646 authored by Gurucharan Shetty's avatar Gurucharan Shetty

ovs-ctl.in: Call 'hostname -f' after vswitchd starts.

Currently we call 'hostname -f' when ovs-vswitchd is not
running. If you are using ovs-vswitchd to provide your
primary networking, then 'hostname -f' will "hang" till it
times out. On the system this issue was discovered, this was
as long as 40 seconds. This is a problem during OVS restarts
or upgrades.

This commit calls 'hostname -f' after ovs-vswitchd has started.

VMware-BZ: #1972026
Signed-off-by: default avatarGurucharan Shetty <guru@ovn.org>
Acked-by: default avatarBen Pfaff <blp@ovn.org>
parent 4a0c670a
......@@ -75,6 +75,12 @@ ovs_vsctl () {
ovs-vsctl --no-wait "$@"
}
set_hostname () {
# 'hostname -f' needs network connectivity to work. So we should
# call this only after ovs-vswitchd is running.
ovs_vsctl set Open_vSwitch . external-ids:hostname="$(hostname -f)"
}
set_system_ids () {
set ovs_vsctl set Open_vSwitch .
......@@ -108,8 +114,6 @@ set_system_ids () {
esac
set "$@" external-ids:system-id="\"$SYSTEM_ID\""
set "$@" external-ids:hostname="\"$(hostname -f)\""
set "$@" external-ids:rundir="\"$rundir\""
if test X"$SYSTEM_TYPE" != X; then
......@@ -254,6 +258,7 @@ start_forwarding () {
if test X"$OVS_VSWITCHD" = Xyes; then
do_start_forwarding || return 1
fi
set_hostname &
return 0
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment