Initial cut at merging vswitch and vswitch-brcompatd init files.
authorKeith Amidon <keith@nicira.com>
Mon, 27 Apr 2009 18:09:52 +0000 (11:09 -0700)
committerKeith Amidon <keith@nicira.com>
Mon, 27 Apr 2009 22:48:50 +0000 (15:48 -0700)
vswitchd/etc/init.d/vswitch
vswitchd/etc/init.d/vswitch-brcompatd [deleted file]
vswitchd/etc/sysconfig/vswitch.example

index 8b7d53daf59c40dce0f914a6af7ee2862eb6ce12..cd83ffe06f4e117ff0947d9b27a68dbd8f4afbdd 100755 (executable)
@@ -8,13 +8,16 @@
 
 . /etc/init.d/functions
 
-MANAGEMENT_INTERFACE=""
-if [ -f /etc/xensource-inventory ]; then
-    . /etc/xensource-inventory
-fi
-
 test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch
+
+# General config variables in /etc/sysconfig/vswitch
 VSWITCH_BASE="${VSWITCH_BASE:-/root/vswitch}"
+ENABLE_BRCOMPAT="${ENABLE_BRCOMPAT:-y}"
+ENABLE_FAKE_PROC_NET="${ENABLE_FAKE_PROC_NET:-y}"
+FORCE_COREFILES="${FORCE_COREFILES:-n}"
+COREFILE_PATTERN="${COREFILE_PATTERN:-/var/log/%e-%t}"
+
+# Config variables specific to vswitchd
 VSWITCHD_CONF="${VSWITCHD_CONF:-/etc/vswitchd.conf}"
 VSWITCHD_PIDFILE="${VSWITCHD_PIDFILE:-/var/run/vswitchd.pid}"
 VSWITCHD_PRIORITY="${VSWITCHD_PRIORITY:--5}"
@@ -22,37 +25,132 @@ VSWITCHD_LOGFILE="${VSWITCHD_LOGFILE:-/var/log/vswitchd.log}"
 VSWITCHD_FILE_LOGLEVEL="${VSWITCHD_FILE_LOGLEVEL:-}"
 VSWITCHD_SYSLOG_LOGLEVEL="${VSWITCHD_SYSLOG_LOGLEVEL:-WARN}"
 VSWITCHD_MEMLEAK_LOGFILE="${VSWITCHD_MEMLEAK_LOGFILE:-}"
+VSWITCHD_STRACE_LOG="${VSWITCHD_STRACE_LOG:-}"
+VSWITCHD_STRACE_OPT="${VSWITCHD_STRACE_OPT:-}"
+VSWITCHD_VALGRIND_LOG="${VSWITCHD_VALGRIND_LOG:-}"
+VSWITCHD_VALGRIND_OPT="${VSWITCHD_VALGRIND_OPT:-}"
+
+# Config variables specific brcompatd
 BRCOMPATD_PIDFILE="${BRCOMPATD_PIDFILE:-/var/run/brcompatd.pid}"
 BRCOMPATD_PRIORITY="${BRCOMPATD_PRIORITY:--5}"
 BRCOMPATD_LOGFILE="${BRCOMPATD_LOGFILE:-/var/log/brcompatd.log}"
 BRCOMPATD_FILE_LOGLEVEL="${BRCOMPATD_FILE_LOGLEVEL:-}"
 BRCOMPATD_SYSLOG_LOGLEVEL="${BRCOMPATD_SYSLOG_LOGLEVEL:-WARN}"
 BRCOMPATD_MEMLEAK_LOGFILE="${BRCOMPATD_MEMLEAK_LOGFILE:-}"
+BRCOMPATD_STRACE_LOG="${BRCOMPATD_STRACE_LOG:-}"
+BRCOMPATD_STRACE_OPT="${BRCOMPATD_STRACE_OPT:-}"
+BRCOMPATD_VALGRIND_LOG="${BRCOMPATD_VALGRIND_LOG:-}"
+BRCOMPATD_VALGRIND_OPT="${BRCOMPATD_VALGRIND_OPT:-}"
+
+
+
+
+# Full paths to executables & modules
+vswitchd="$VSWITCH_BASE/sbin/vswitchd"
+brcompatd="$VSWITCH_BASE/sbin/brcompatd"
+dpctl="$VSWITCH_BASE/bin/dpctl"
+vlogconf="$VSWITCH_BASE/bin/vlogconf"
+
+
+if [ "$ENABLE_FAKE_PROC_NET" == "y" ]; then
+    if [ "$ENABLE_BRCOMPAT" != "y" ]; then
+        warning "FAKE_PROC_NET required BRCOMPAT which was disabled.  Force enabling."
+        ENABLE_BRCOMPAT="y"
+    fi
+fi
 
 function dp_list {
-    $VSWITCH_BASE/bin/dpctl dp-show | grep '^dp[0-9]\+:' | cut -d':' -f 1
+    "$dpctl" dp-show | grep '^dp[0-9]\+:' | cut -d':' -f 1
 }
 
 function dp_intf {
     local dp=$1
     # Currently port0 is hardcoded to be the local port.
-    $VSWITCH_BASE/bin/dpctl dp-show $dp | grep 'port 0:' | cut -d' ' -f 3
+    "$dpctl" dp-show $dp | grep 'port 0:' | cut -d' ' -f 3
 }
 
-function clear_old_bridge_ports {
-    mv $VSWITCHD_CONF $VSWITCHD_CONF.prev
-    grep  -v '^bridge\.[^.]\+\.port[ \t]*=' $VSWITCHD_CONF.prev > $VSWITCHD_CONF
+function ifdown_dp_intf {
+    for dp in $(dp_list); do
+        local intf=$(dp_intf $dp)
+        if [ -e "/etc/sysconfig/network-scripts/ifcfg-$intf" ]; then
+            action "Bringing up datapath interface: $intf" ifdown "$intf"
+        fi
+    done
 }
 
-function start {
+function xen_mgmt_intf {
+    ( test -e /etc/xensource-inventory \
+        && source /etc/xensource-inventory \
+        && echo "$MANAGEMENT_INTERFACE" )
+}
+
+function xen_mgmt_pifdev {
+    ( test -e "/etc/sysconfig/network-scripts/ifcfg-$1" \
+        && source "/etc/sysconfig/network-scripts/ifcfg-$1" \
+        && echo "$PIFDEV" )
+}
+
+function xen_pifdev_hwaddr {
+    ( test -e "/etc/sysconfig/network-scripts/ifcfg-$1" \
+        && source "/etc/sysconfig/network-scripts/ifcfg-$1" \
+        && echo "$HWADDR" )
+}
+
+function allow_xen_mgmt_traffic {
+    local mgmt_intf=$(xen_mgmt_intf)
+    test -n "$mgmt_intf" || return
+    # TBD: This needs to be extended to deal with VLANs, etc.
+    local mgmt_pifdev=$(xen_mgmt_pifdev "$mgmt_intf")
+    test -n "$mgmt_pifdev" || return
+    local mgmt_hwaddr=$(xen_pifdev_hwaddr "$mgmt_pifdev")
+    test -n "$mgmt_hwaddr" || return
+    action "Inserting dl_addr $mgmt_hwaddr flows for mgmt intf" true
+    "$dpctl" add-flow "$mgmt_intf" dl_src="$mgmt_hwaddr",idle_timeout=0,priority=0,action=normal
+    "$dpctl" add-flow "$mgmt_intf" dl_dst="$mgmt_hwaddr",idle_timeout=0,priority=0,action=normal
+}
+
+function ifup_dp_intf {
+    for dp in $(dp_list); do
+        local intf=$(dp_intf $dp)
+        if [ -e "/etc/sysconfig/network-scripts/ifcfg-$intf" ]; then
+            action "Bringing up datapath interface: $intf" ifup "$intf"
+        fi
+    done
+}
+
+function turn_on_corefiles {
+    # This has global effect so should not normally be used...
+    ulimit -c unlimited
+    echo "$COREFILE_PATTERN" > /proc/sys/kernel/core_pattern
+}
+
+function insert_modules_if_required {
     if ! lsmod | grep -q "openflow_mod"; then
         action "Inserting openflow module" insmod $VSWITCH_BASE/kernel_modules/openflow_mod.ko
     fi
     if [ -n "$BRCOMPATD_PIDFILE" ] && ! lsmod | grep -q "brcompat_mod"; then
         action "Inserting brcompat module" insmod $VSWITCH_BASE/kernel_modules/brcompat_mod.ko
     fi
-    ulimit -c unlimited   # Ensure core dump on crash. Will be in '/'.
-    echo "/var/log/%e-%t" > /proc/sys/kernel/core_pattern
+}
+
+function remove_modules {
+    if ! lsmod | grep -q "openflow_mod"; then
+        action "Removing openflow module" rmmod openflow_mod.ko
+    fi
+    if ! lsmod | grep -q "openflow_mod"; then
+        action "Removing brcompat module" rmmod brcompat_mod.ko
+    fi
+}
+
+function reload_vswitchd {
+    if [ -f "$VSWITCHD_PIDFILE" ]; then
+        "$vlogconf" \
+            --target=vswitchd.$(cat "$VSWITCHD_PIDFILE").ctl \
+            --execute=vswitchd/reload
+    fi
+}
+
+function start_vswitchd {
     local syslog_opt="-vANY:SYSLOG:${VSWITCHD_SYSLOG_LOGLEVEL}"
     local logfile_file_opt=""
     local logfile_level_opt=""
@@ -68,111 +166,151 @@ function start {
         fi
     fi
     local strace_opt=""
-    local daemonize_opt="-D"
-    if [ -n "$STRACE_LOG" ] && [ -n "$VALGRIND_LOG" ]; then
+    local daemonize="y"
+    if [ -n "$VSWITCHD_STRACE_LOG" ] && [ -n "$VSWITCHD_VALGRIND_LOG" ]; then
         printf "Can not start with both VALGRIND and STRACE\n"
         exit 1
     fi
-    if [ -n "$STRACE_LOG" ]; then
-        strace_opt="strace -o $STRACE_LOG $STRACE_OPT"
-        daemonize_opt=""
+    if [ -n "$VSWITCHD_STRACE_LOG" ]; then
+        strace_opt="strace -o $VSWITCHD_STRACE_LOG $VSWITCHD_STRACE_OPT"
+        daemonize="n"
+    fi
+    if [ -n "$VSWITCHD_VALGRIND_LOG" ]; then
+        valgrind_opt="valgrind --log-file=$VSWITCHD_VALGRIND_LOG $VSWITCHD_VALGRIND_OPT"
+        daemonize="n"
+    fi
+    local fake_proc_net_opt=""
+    if [ "$ENABLE_FAKE_PROC_NET" == "y" ]; then
+        fake_proc_net_opt="--fake-proc-net"
+    fi
+    if [ "$daemonize" != "y" ]; then
+        # Start in background and force a "success" message
+        action "Starting vswitchd ($strace_opt$valgrind_opt)" true
+        (nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt "$vswitchd" -P"$VSWITCHD_PIDFILE" -D $fake_proc_net_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF") &
+    else
+        action "Starting vswitchd" nice -n "$VSWITCHD_PRIORITY" "$vswitchd" -P"$VSWITCHD_PIDFILE" -D $fake_proc_net_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF"
     fi
-    if [ -n "$VALGRIND_LOG" ]; then
-        valgrind_opt="valgrind --log-file=$VALGRIND_LOG $VALGRIND_OPT"
-        daemonize_opt=""
-    fi
-    action "Starting vswitchd" nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt $VSWITCH_BASE/sbin/vswitchd -P"$VSWITCHD_PIDFILE" $daemonize_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF"
-    sleep 2    # Give time for vswitch to get up and running.
-    # In Xen environments, always attempt to force the management
-    # bridge interface up because otherwise vswitch and XAPI interact
-    # badly on startup.
-    if [ -n "$MANAGEMENT_INTERFACE" ] && [ -e "/etc/sysconfig/network-scripts/ifcfg-$MANAGEMENT_INTERFACE" ]; then
-        action "Bringing up management interface: $MANAGEMENT_INTERFACE" ifup "$MANAGEMENT_INTERFACE" 
-    fi
-    # When attempting to restart or update modules online, bring up
-    # all bridge interfaces since presumably they were in use before
-    # we went down.
-    for dp in $(dp_list); do
-        local intf=$(dp_intf $dp)
-        if [ -e "/etc/sysconfig/network-scripts/ifcfg-$intf" ]; then
-            if [ "$1" == "update-modules" ]; then
-                action "Bringing up datapath interface: $intf" ifup "$intf"
-            fi
-        fi
-    done
 }
 
-function stop {
-    if [ "$1" == "update-modules" ] && [ -n "$BRCOMPATD_PIDFILE" ] && [ -e "$BRCOMPATD_PIDFILE" ]; then
-        printf "brcompatd must be stopped to allow module unloading.\n"
+function start_brcompatd {
+    local syslog_opt="-vANY:SYSLOG:${BRCOMPATD_SYSLOG_LOGLEVEL}"
+    local logfile_file_opt=""
+    local logfile_level_opt=""
+    if [ -n "$BRCOMPATD_FILE_LOGLEVEL" ]; then
+        logfile_level_opt="-vANY:FILE:${BRCOMPATD_FILE_LOGLEVEL}"
+        logfile_file_opt="--log-file=$BRCOMPATD_LOGFILE"
+    fi
+    local leak_opt=""
+    if [ -n "$BRCOMPATD_MEMLEAK_LOG" ]; then
+        leak_opt="--check-leaks=$BRCOMPATD_MEMLEAK_LOGFILE"
+        if [ -e "$BRCOMPATD_MEMLEAK_LOGFILE" ]; then
+            mv "$BRCOMPATD_MEMLEAK_LOGFILE" "$BRCOMPATD_MEMLEAK_LOGFILE.prev"
+        fi
+    fi
+    local strace_opt=""
+    local daemonize="y"
+    if [ -n "$BRCOMPATD_STRACE_LOG" ] && [ -n "$BRCOMPATD_VALGRIND_LOG" ]; then
+        printf "Can not start with both VALGRIND and STRACE\n"
         exit 1
     fi
+    if [ -n "$BRCOMPATD_STRACE_LOG" ]; then
+        strace_opt="strace -o $BRCOMPATD_STRACE_LOG $BRCOMPATD_STRACE_OPT"
+        daemonize="n"
+    fi
+    if [ -n "$VALGRIND_LOG" ]; then
+        valgrind_opt="valgrind --log-file=$BRCOMPATD_VALGRIND_LOG $BRCOMPATD_VALGRIND_OPT"
+        daemonize="n"
+    fi
+    if [ "$daemonize" != "y" ]; then
+        # Start in background and force a "success" message
+        action "Starting brcompatd ($strace_opt$valgrind_opt)" true
+        (nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt "$brcompatd" -P$BRCOMPATD_PIDFILE --vswitchd-pidfile=$VSWITCHD_PIDFILE -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF") &
+    else
+        action "Starting brcompatd" nice -n "$BRCOMPATD_PRIORITY" $strace_opt $valgrind_opt "$brcompatd" -P$BRCOMPATD_PIDFILE --vswitchd-pidfile=$VSWITCHD_PIDFILE -D -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF"
+    fi
+}
+
+function stop_vswitchd {
     if [ -f "$VSWITCHD_PIDFILE" ]; then
         local pid=$(cat "$VSWITCHD_PIDFILE")
         action "Killing vswitchd ($pid)" kill -TERM $pid
-    fi
-    if [ -e "$VSWITCHD_PIDFILE" ]; then
         rm -f "$VSWITCHD_PIDFILE"
     fi
-    if [ "$1" = "update-modules" ]; then
-        for dp in $(dp_list); do
-            local intf=$(dp_intf $dp)
-            action "Removing datapath: $dp" $VSWITCH_BASE/bin/dpctl deldp $dp
-            if [ -e "/etc/sysconfig/network-scripts/ifcfg-$intf" ]; then
-                action "Shutting down datapath interface: $intf" ifdown "$intf"
-            fi
-        done
-        if [ -n "$BRCOMPATD_PIDFILE" ]; then
-            action "Removing brcompat module" rmmod brcompat_mod.ko
-        fi
-        action "Removing openflow module" rmmod openflow_mod.ko
+}
+
+function stop_brcompatd {
+    if [ -f "$BRCOMPAT_PIDFILE" ]; then
+        local pid=$(cat "$BRCOMPATD_PIDFILE")
+        action "Killing brcompatd ($pid)" kill -TERM $pid
+        rm -f "$BRCOMPATD_PIDFILE"
+    fi
+}
+
+function start {
+    insert_modules_if_required
+    start_vswitchd
+    start_brcompatd
+    reload_vswitchd  # ensures vswitchd has fully read config file.
+    allow_xen_mgmt_traffic
+}
+
+function stop {
+    stop_brcompatd
+    stop_vswitchd
+    if [ "$1" == "unload_modules" ]; then
+        ifdown_dp_intf
+        remove_modules
+    fi
+}
+
+function restart {
+    if [ "$1" == "unload_modules" ]; then
+        stop unload_modules
+        start
+        ifup_dp_intf
+    else
+        stop
+        start
     fi
 }
 
 case "$1" in
     start)
+        if [ "$FORCE_COREFILES" == "y" ]; then
+            turn_on_corefiles
+        fi
         start
         ;;
     stop)
         stop
         ;;
     restart)
-        stop
-        start restart
-        ;;
-    restart-strace)
-        shift
-        stop
-        STRACE_LOG="/var/log/vswitchd.strace" STRACE_OPT="$*" start restart
-        ;;
-    restart-valgrind)
-        shift
-        stop
-        VALGRIND_LOG="/var/log/vswitchd.valgrind" VALGRIND_OPT="$*" start restart
-        ;;
-    update-modules)
-        stop update-modules
-        start update-modules
+        restart
         ;;
     reload)
-        if [ -f "$VSWITCHD_PIDFILE" ]; then
-            "$VSWITCH_BASE"/bin/vlogconf \
-                --target=vswitchd.$(cat "$VSWITCHD_PIDFILE").ctl \
-                --execute=vswitchd/reload
-        fi
+        reload_vswitchd
         ;;
-    strace)
+    strace-vswitchd)
         shift
         strace -p $(cat "$VSWITCHD_PIDFILE") "$@"
         ;;
+    strace-brcompatd)
+        shift
+        strace -p $(cat "$BRCOMPATD_PIDFILE") "$@"
+        ;;
     unload)
-        stop update-modules
+        stop unload_modules
+        ;;
+    update-modules)
+        restart unload_modules
         ;;
     status)
         status -p vswitchd.pid vswitchd
+        status -p brcompatd.pid brcompatd
         ;;
     version)
         "$VSWITCH_BASE"/sbin/vswitchd -V
+        "$VSWITCH_BASE"/sbin/brcompatd -V
         ;;
     help)
         printf "vswitch [start|stop|restart|reload|unload|status|version]\n"
diff --git a/vswitchd/etc/init.d/vswitch-brcompatd b/vswitchd/etc/init.d/vswitch-brcompatd
deleted file mode 100755 (executable)
index f276f15..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/bin/bash
-#
-# vswitch-brcompatd
-#
-# chkconfig: 2345 09 91
-# description: Manage bridge compatibility daemon for vswitchd
-#
-
-. /etc/init.d/functions
-
-test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch
-VSWITCH_BASE="${VSWITCH_BASE:-/root/vswitch}"
-VSWITCHD_CONF="${VSWITCHD_CONF:-/etc/vswitchd.conf}"
-VSWITCHD_PIDFILE="${VSWITCHD_PIDFILE:-/var/run/vswitchd.pid}"
-VSWITCHD_PRIORITY="${VSWITCHD_PRIORITY:--5}"
-VSWITCHD_LOGFILE="${VSWITCHD_LOGFILE:-/var/log/vswitchd.log}"
-VSWITCHD_FILE_LOGLEVEL="${VSWITCHD_FILE_LOGLEVEL:-}"
-VSWITCHD_SYSLOG_LOGLEVEL="${VSWITCHD_SYSLOG_LOGLEVEL:-WARN}"
-VSWITCHD_MEMLEAK_LOGFILE="${VSWITCHD_MEMLEAK_LOGFILE:-}"
-BRCOMPATD_PIDFILE="${BRCOMPATD_PIDFILE:-/var/run/brcompatd.pid}"
-BRCOMPATD_PRIORITY="${BRCOMPATD_PRIORITY:--5}"
-BRCOMPATD_LOGFILE="${BRCOMPATD_LOGFILE:-/var/log/brcompatd.log}"
-BRCOMPATD_FILE_LOGLEVEL="${BRCOMPATD_FILE_LOGLEVEL:-}"
-BRCOMPATD_SYSLOG_LOGLEVEL="${BRCOMPATD_SYSLOG_LOGLEVEL:-WARN}"
-BRCOMPATD_MEMLEAK_LOGFILE="${BRCOMPATD_MEMLEAK_LOGFILE:-}"
-
-function start {
-    if [ -z "$BRCOMPATD_PIDFILE" ]; then
-        printf "No BRCOMPATD_PIDFILE specified.  Check /etc/sysconfig/vswitch\n"
-        exit 1
-    fi
-    ulimit -c unlimited   # Ensure core dump on crash. Will be in '/'.
-    echo "/var/log/%e-%t" > /proc/sys/kernel/core_pattern
-    local syslog_opt="-vANY:SYSLOG:${BRCOMPATD_SYSLOG_LOGLEVEL}"
-    local logfile_file_opt=""
-    local logfile_level_opt=""
-    if [ -n "$BRCOMPATD_FILE_LOGLEVEL" ]; then
-        logfile_level_opt="-vANY:FILE:${BRCOMPATD_FILE_LOGLEVEL}"
-        logfile_file_opt="--log-file=$BRCOMPATD_LOGFILE"
-    fi
-    local leak_opt=""
-    if [ -n "$BRCOMPATD_MEMLEAK_LOG" ]; then
-        leak_opt="--check-leaks=$BRCOMPATD_MEMLEAK_LOGFILE"
-        if [ -e "$BRCOMPATD_MEMLEAK_LOGFILE" ]; then
-            mv "$BRCOMPATD_MEMLEAK_LOGFILE" "$BRCOMPATD_MEMLEAK_LOGFILE.prev"
-        fi
-    fi
-    local strace_opt=""
-    local daemonize_opt="-D"
-    if [ -n "$STRACE_LOG" ] && [ -n "$VALGRIND_LOG" ]; then
-        printf "Can not start with both VALGRIND and STRACE\n"
-        exit 1
-    fi
-    if [ -n "$STRACE_LOG" ]; then
-        strace_opt="strace -o $STRACE_LOG $STRACE_OPT"
-        daemonize_opt=""
-    fi
-    if [ -n "$VALGRIND_LOG" ]; then
-        valgrind_opt="valgrind --log-file=$VALGRIND_LOG $VALGRIND_OPT"
-        daemonize_opt=""
-    fi
-    action "Starting brcompatd" nice -n "$BRCOMPATD_PRIORITY" $strace_opt $valgrind_opt $VSWITCH_BASE/sbin/brcompatd -P$BRCOMPATD_PIDFILE --vswitchd-pidfile=$VSWITCHD_PIDFILE $daemonize_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF"
-}
-
-function stop {
-    if [ -f "$BRCOMPAT_PIDFILE" ]; then
-        local pid=$(cat "$BRCOMPATD_PIDFILE")
-        action "Killing brcompatd ($pid)" kill -TERM $pid
-    fi
-    if [ -e "$BRCOMPATD_PIDFILE" ]; then
-        rm -f "$BRCOMPATD_PIDFILE"
-    fi
-}
-
-case "$1" in
-    start)
-        start
-        ;;
-    stop)
-        stop
-        ;;
-    restart)
-        stop
-        start restart
-        ;;
-    restart-strace)
-        shift
-        stop
-        STRACE_LOG="/var/log/brcompatd.strace" STRACE_OPT="$*" start restart
-        ;;
-    restart-valgrind)
-        shift
-        stop
-        VALGRIND_LOG="/var/log/brcompatd.valgrind" VALGRIND_OPT="$*" start restart
-        ;;
-    strace)
-        shift
-        strace -p $(cat "$BRCOMPATD_PIDFILE") "$@"
-        ;;
-    status)
-        status -p brcompatd.pid brcompatd
-        ;;
-    version)
-        "$VSWITCH_BASE"/sbin/brcompatd -V
-        ;;
-    help)
-        printf "vswitch-brcompatd [start|stop|restart|status|version]\n"
-        ;;
-    *)
-        printf "Unknown command: $1\n"
-        exit 1
-        ;;
-esac
index 50e9f7d5b693ae11497dfb186215b678ee2fa839..4fd57598bf19f38a74a3d1c714eaba4080e26b3a 100644 (file)
@@ -3,6 +3,24 @@
 # VSWITCH_BASE: Root directory where vswitch binaries are installed
 # VSWITCH_BASE=/root/vswitch/openflow/build
 
+# ENABLE_BRCOMPAT: If 'y' than emulate linux bridging interfaces
+#    using the brcompat kernel module and brcompatd daemon
+# ENABLE_BRCOMPAT=y
+
+# ENABLE_FAKE_PROC_NET: If 'y' then emulate linux bonding and vlan
+#    files in /proc as if the bonding and vlan demultiplexing done in
+#    vswitchd were being implemented using existing Linux mechanisms.
+#    This is useful in some cases when replacing existing solutions.
+# ENABLE_FAKE_PROC_NET=y
+
+# FORCE_COREFILES: If 'y' then core files will be enabled.
+# FORCE_COREFILES=n
+
+# COREFILE_PATTERN: Pattern used to determine path and filename for
+#     core files when FORCE_COREFILES is 'y'.  This is Linux specific.
+#     See the manpage for "core".
+# COREFILE_PATTERN="/var/log/%e-%t"
+
 # VSWITCHD_CONF: File in which vswitchd stores its configuration.
 # VSWITCHD_CONF=/etc/vswitchd.conf
 
 #     emergency and warning level messages only.
 # VSWITCHD_SYSLOG_LOGLEVEL="WARN"
 
-# VSWITCHD_MEMLEAK_LOGFILE: if non-null, must be filename to which memory
-#     usage log is written by vswitchd.  This log file can be
-#     postprocessed to find incorrect memory allocation and free
-#     behavior.  If null or not set, no log will be generated.  Note
-#     that generating the log causes a significant performance hit and
-#     should only be done when debugging issues.
-# VSWITCHD_MEMLEAK_LOGFILE=""
-
 # BRCOMPATD_PIDFILE: File in which to store the pid of the running
 #     brcompatd (the Linux bridge compatibility daemon for vswitchd).
 #     If this is the empty string, brcompatd will not be started and
 #     this is null or not set the default is to log to syslog
 #     emergency and warning level messages only.
 # BRCOMPATD_SYSLOG_LOGLEVEL="WARN"
-
-# BRCOMPATD_MEMLEAK_LOG: if non-null, must be filename to which memory
-#     usage log is written by vswitchd.  This log file can be
-#     postprocessed to find incorrect memory allocation and free
-#     behavior.  If null or not set, no log will be generated.  Note
-#     that generating the log causes a significant performance hit and
-#     should only be done when debugging issues.
-# BRCOMPATD_MEMLEAK_LOG=""
-