From: Gurucharan Shetty Date: Wed, 24 Oct 2012 20:19:24 +0000 (-0700) Subject: ovs-ctl.in: Don't save flows if the daemons are not running. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03d589afc85bd3a7bb29c10bcd366835b1253e97;p=openvswitch ovs-ctl.in: Don't save flows if the daemons are not running. When a 'ovs-ctl restart' is executed and the userspace daemons like ovsdb-server and ovs-vswitchd are not running, attempt to save flows can wait forever. This also results in the daemons from not getting started. Signed-off-by: Gurucharan Shetty --- diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index 9ce4973d..e8b72bad 100755 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -405,10 +405,12 @@ force_reload_kmod () { ## ------- ## restart () { - script_flows=`mktemp` - trap 'rm -f "${script_flows}"' 0 1 2 13 15 + if daemon_is_running ovsdb-server && daemon_is_running ovs-vswitchd; then + script_flows=`mktemp` + trap 'rm -f "${script_flows}"' 0 1 2 13 15 - action "Saving flows" save_flows + action "Saving flows" save_flows + fi # Restart the database first, since a large database may take a # while to load, and we want to minimize forwarding disruption.