. /etc/init.d/functions
test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch
-VSWITCH_BASE="${VSWITCH_BASE:-/root/vswitch/openflow/build}"
+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}"
BRCOMPATD_MEMLEAK_LOGFILE="${BRCOMPATD_MEMLEAK_LOGFILE:-}"
function dp_list {
- $VSWITCH_BASE/utilities/dpctl dp-show | grep '^dp[0-9]\+:' | cut -d':' -f 1
+ $VSWITCH_BASE/bin/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/utilities/dpctl dp-show $dp | grep 'port 0:' | cut -d' ' -f 3
+ $VSWITCH_BASE/bin/dpctl dp-show $dp | grep 'port 0:' | cut -d' ' -f 3
}
function clear_old_bridge_ports {
function start {
if ! lsmod | grep -q "openflow_mod"; then
- action "Inserting openflow module" insmod $VSWITCH_BASE/datapath/linux-2.6/openflow_mod.ko
+ 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/datapath/linux-2.6/brcompat_mod.ko
+ 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
daemonize_opt=""
fi
#[ "$1" = "update-modules" ] || [ "$1" = "restart" ] || clear_old_bridge_ports
- action "Starting vswitchd" nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt $VSWITCH_BASE/vswitchd/vswitchd -P"$VSWITCHD_PIDFILE" $daemonize_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF"
+ 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"
# Always attempt to force bridge interfaces up because otherwise
# vswitch and XAPI interact badly on startup
sleep 2 # Give time for vswitch to get up and running.
if [ "$1" = "update-modules" ]; then
for dp in $(dp_list); do
local intf=$(dp_intf $dp)
- action "Removing datapath: $dp" $VSWITCH_BASE/utilities/dpctl deldp $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
status -p vswitchd.pid vswitchd
;;
version)
- "$VSWITCH_BASE"/vswitchd/vswitchd -V
+ "$VSWITCH_BASE"/sbin/vswitchd -V
;;
help)
printf "vswitch [start|stop|restart|reload|unload|status|version]\n"
. /etc/init.d/functions
test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch
-VSWITCH_BASE="${VSWITCH_BASE:-/root/vswitch/openflow/build}"
+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}"
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/vswitchd/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"
+ 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 {
status -p brcompatd.pid brcompatd
;;
version)
- "$VSWITCH_BASE"/vswitchd/brcompatd -V
+ "$VSWITCH_BASE"/sbin/brcompatd -V
;;
help)
printf "vswitch-brcompatd [start|stop|restart|status|version]\n"