xenserver: Create vswitchd configuration file if it does not exist.
authorBen Pfaff <blp@nicira.com>
Thu, 3 Sep 2009 19:51:51 +0000 (12:51 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 3 Sep 2009 20:00:11 +0000 (13:00 -0700)
/etc/ovs-vswitchd.conf should always be there.  Nevertheless, it is not
nice to entirely break vswitch if it is accidentally deleted.  This commit
makes /etc/init.d/vswitch create an empty configuration file if it is
missing.

Bug #1821.

xenserver/etc_init.d_vswitch

index abd594e..ee858fd 100755 (executable)
@@ -286,6 +286,11 @@ function start {
     # ovs-vswitchd needs a few per bridge
     ulimit -n 4096
 
+    if [ ! -e "$VSWITCHD_CONF" ]; then
+        warning "$VSWITCHD_CONF does not exist"
+        action "Creating empty $VSWITCHD_CONF" touch "$VSWITCHD_CONF"
+    fi
+
     start_vswitchd
     start_brcompatd
     reload_vswitchd  # ensures ovs-vswitchd has fully read config file.