summaryrefslogtreecommitdiff
path: root/tutorial
diff options
context:
space:
mode:
authorAndy Zhou <azhou@nicira.com>2015-04-10 12:53:26 -0700
committerAndy Zhou <azhou@nicira.com>2015-04-14 14:52:34 -0700
commite43a07ba6e8995c196d20841ea58208232a3ffd8 (patch)
treede4df799836a549a52486535f52e7d89befa2716 /tutorial
parentd663136e85bdb88ec11c617bbf07570f612b81e4 (diff)
downloadopenvswitch-e43a07ba6e8995c196d20841ea58208232a3ffd8.tar.gz
ovs-sandbox: add delay before running ovs-vsctl
When running ovsdb-server under gdb, there is a race that ovs-vsctl command can be called before ovsdb-server is fully launched. This will cause ovs-vsctl to fail. This patch fixes this by delay issuing the ovs-vsctl command until ovsdb-server is fully launched. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'tutorial')
-rwxr-xr-xtutorial/ovs-sandbox12
1 files changed, 12 insertions, 0 deletions
diff --git a/tutorial/ovs-sandbox b/tutorial/ovs-sandbox
index 251f021bc..ebee4a9fb 100755
--- a/tutorial/ovs-sandbox
+++ b/tutorial/ovs-sandbox
@@ -235,6 +235,18 @@ run ovsdb-tool create conf.db "$schema"
rungdb $gdb_ovsdb ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file \
--remote=punix:"$sandbox"/db.sock
+#Add a small delay to allow ovsdb-server to launch.
+sleep 0.1
+
+#Wait for ovsdb-server to finish launching.
+if test ! -e "$sandbox"/db.sock; then
+ echo -n "Waiting for ovsdb-server to start..."
+ while test ! -e "$sandbox"/db.sock; do
+ sleep 1;
+ done
+ echo " Done"
+fi
+
# Initialize database.
run ovs-vsctl --no-wait -- init