Merge "citrix" branch into "master.
[sliver-openvswitch.git] / xenserver / etc_init.d_vswitch
index 8f0adf7..01450ed 100755 (executable)
@@ -264,16 +264,26 @@ function start {
     if [ ! -e "$VSWITCHD_CONF" ]; then
         warning "$VSWITCHD_CONF does not exist"
         action "Creating empty $VSWITCHD_CONF" touch "$VSWITCHD_CONF"
+    elif [ ! -e /var/run/vswitch.booted ]; then
+        touch /var/run/vswitch.booted
+        /usr/bin/ovs-cfg-mod '-vANY:console:emer' -F "$VSWITCHD_CONF" \
+            '--del-match=bridge.*' \
+            '--del-match=port.*' \
+            '--del-match=bonding.*' \
+            '--del-match=iface.*' \
+            '--del-match=vlan.*'
     fi
 
     start_vswitchd
     start_brcompatd
     reload_vswitchd  # ensures ovs-vswitchd has fully read config file.
+    touch /var/lock/subsys/vswitch
 }
 
 function stop {
     stop_brcompatd
     stop_vswitchd
+    rm -f /var/lock/subsys/vswitch
 }
 
 function restart {