From 6b2771c347547b835cf425878d1d3e636631b1d5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 25 Mar 2015 22:25:50 -0700 Subject: ovs-sandbox: Initialize database before starting ovs-vswitchd. Otherwise ovs-vswitchd can't immediately start working (until some other call to ovs-vsctl initializes the database). This is most obvious if one runs "ovs-vsctl list Open_vSwitch ." as the first command, because the output will not show the changes that ovs-vswitchd will make to the database at startup (in particular initializing datapath_types and iface_types), which is confusing. Signed-off-by: Ben Pfaff Acked-by: Russell Bryant --- tutorial/ovs-sandbox | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tutorial') diff --git a/tutorial/ovs-sandbox b/tutorial/ovs-sandbox index 1504ea9f8..9520a41c4 100755 --- a/tutorial/ovs-sandbox +++ b/tutorial/ovs-sandbox @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2013 Nicira, Inc. +# Copyright (c) 2013, 2015 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -235,6 +235,9 @@ 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 +# Initialize database. +run ovs-vsctl --no-wait -- init + # Start ovs-vswitchd. rungdb $gdb_vswitchd ovs-vswitchd --detach --no-chdir --pidfile -vconsole:off --log-file \ --enable-dummy=override -vvconn -vnetdev_dummy -- cgit v1.2.1 From fdc14c7b33338c78b27d277c864f47c8a37adb36 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 3 Apr 2015 16:04:14 -0400 Subject: ovs-sandbox: Tell gdb to start the daemon. The current gdb support launches gdb but doesn't start the daemon. If you start ovsdb-server with gdb, ovs-sandbox produces an error as it tries to run ovs-vsctl before ovsdb-server is running. Telling gdb to start the daemon immediately avoids this error. There are cases where it's useful to go straight to the gdb prompt, too. For example, someone may want to set a breakpoint. In that case, it's easy enough to just kill it, set a breakpoint, and execute 'run' again. In passing, fix indentation to use spaces instead of tabs. Signed-off-by: Russell Bryant Signed-off-by: Ben Pfaff --- tutorial/ovs-sandbox | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tutorial') diff --git a/tutorial/ovs-sandbox b/tutorial/ovs-sandbox index 9520a41c4..251f021bc 100755 --- a/tutorial/ovs-sandbox +++ b/tutorial/ovs-sandbox @@ -35,8 +35,8 @@ rungdb() { # Use "DISPLAY" variable to determine out if X is supported if $under_gdb && [ "$DISPLAY" ]; then args=`echo $@ |sed s/--detach//g | sed s/--vconsole:off//g` - xterm_title=$1 - run_xterm $xterm_title gdb --args $args + xterm_title=$1 + run_xterm $xterm_title gdb -ex run --args $args else run $@ fi -- cgit v1.2.1