[ovs-dev] [PATCH] xenserver: Create vswitchd configuration file if it does not exist.

Ben Pfaff blp at nicira.com
Thu Sep 3 12:51:58 PDT 2009


/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 |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xenserver/etc_init.d_vswitch b/xenserver/etc_init.d_vswitch
index abd594e..ee858fd 100755
--- a/xenserver/etc_init.d_vswitch
+++ b/xenserver/etc_init.d_vswitch
@@ -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.
-- 
1.6.3.3





More information about the dev mailing list