X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xenserver%2Fetc_init.d_openvswitch;h=a15ab2b416199ce4838cd9e231e0bb81405d047b;hb=89b9612d11e6ff92b176d9674983721c8c9fd3b0;hp=bf7ae4e8a9910662a0810b10b8e14d86a233028c;hpb=e7eacf16f52a69d73afbdfda62d2d181282fbdf4;p=openvswitch diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index bf7ae4e8..a15ab2b4 100755 --- a/xenserver/etc_init.d_openvswitch +++ b/xenserver/etc_init.d_openvswitch @@ -24,6 +24,12 @@ . /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. @@ -202,7 +208,7 @@ function start_daemon { else local mode=production eval local pidfile=\$${DAEMON}_PIDFILE - install -d -m 755 -o root -g root `dirname $VSWITCHD_PIDFILE` + install -d -m 755 -o root -g root `dirname $pidfile` set -- "$@" --pidfile="$pidfile" --detach $monitor_opt --no-chdir fi @@ -216,7 +222,7 @@ function start_daemon { action "Starting `basename $BINARY`" "$@" else # Start in background and force a "success" message - action "Starting ovs-vswitchd with $mode debugging" true + action "Starting `basename $BINARY` with $mode debugging" true ("$@") & fi } @@ -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 {