vswitchd: Fix documentation of "agent" column in "sFlow" table.
[openvswitch] / xenserver / etc_init.d_openvswitch
index bf4dd6c88dad4c8ec5665bc37374eb3c204e4ee8..a15ab2b416199ce4838cd9e231e0bb81405d047b 100755 (executable)
 . /etc/xensource-inventory
 test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch
 
+NETWORK_MODE=$(cat /etc/xensource/network.conf)
+if test "$NETWORK_MODE" = bridge; then
+    echo "Open vSwitch disabled (/etc/xensource/network.conf is 'bridge')" >&2
+    exit 0
+fi
+
 # General config variables in /etc/sysconfig/openvswitch
 if test "$PRODUCT_VERSION" = "5.5.0"; then
     # XenServer 5.5.0 needs ovs-brcompatd and /proc/net simulation.
@@ -252,13 +258,7 @@ function start_brcompatd {
 }
 
 function start_xenserverd {
-    if [ ! -d "$XENSERVERD_RUN_DIR" ]; then
-        install -d -m 755 -o root -g root "$XENSERVERD_RUN_DIR"
-    fi
-    cd "$XENSERVERD_RUN_DIR"
-
-    install -d -m 755 -o root -g root `dirname $XENSERVERD_PIDFILE`
-    action "Starting ovs-xenserverd" "$xenserverd" --no-chdir --pidfile=$XENSERVERD_PIDFILE --detach $monitor_opt -vANY:CONSOLE:EMER
+    start_daemon XENSERVERD "$xenserverd"
 }
 
 function stop_daemon {