unset MGMT_VCONNS
unset COMMANDS
unset DAEMON_OPTS
+unset CORE_LIMIT
+unset DATAPATH_ID
default=/etc/default/openflow-switch
if [ -f $default ] ; then
. $default
kill -9 $pid
[ -n "$DODTIME" ] && sleep "$DODTIME"s
if running ; then
- echo "Cannot kill $LABEL (pid=$pid)!"
+ echo "Cannot kill $NAME (pid=$pid)!"
exit 1
fi
fi
must_succeed "Adding $netdev to datapath" dpctl addif nl:0 $netdev
done
+ xx='[0-9abcdefABCDEF][0-9abcdefABCDEF]'
+ case $DATAPATH_ID in
+ '')
+ ;;
+ $xx:$xx:$xx:$xx:$xx:$xx)
+ ifconfig of0 down
+ must_succeed "Setting of0 MAC address to $DATAPATH_ID" ifconfig of0 hw ether $DATAPATH_ID
+ ifconfig of0 up
+ ;;
+ *)
+ echo "DATAPATH_ID is not a valid MAC address in the form XX:XX:XX:XX:XX:XX, ignoring" >&2
+ ;;
+ esac
+
if test "$MODE" = in-band; then
if test "$SWITCH_IP" = dhcp; then
must_succeed "Temporarily disabling of0" ifconfig of0 down
MGMT_OPTS="$MGMT_OPTS --listen=$vconn"
done
+ MONITOR_OPT=
+ if test -n "$MONITOR_VCONN"; then
+ MONITOR_OPT="--monitor=$MONITOR_VCONN"
+ fi
+
COMMAND_OPT=
if test -n "$COMMANDS"; then
COMMAND_OPT="--command-acl=$COMMANDS"
DAEMON_OPTS="$DAEMON_OPTS --out-of-band"
fi
+ if test -n "$CORE_LIMIT"; then
+ check_op "Setting core limit to $CORE_LIMIT" ulimit -c "$CORE_LIMIT"
+ fi
+
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- nl:0 $CONTROLLER --detach --pidfile=$PIDFILE \
--verbose=ANY:console:emer --verbose=ANY:syslog:err --log-file \
- $DAEMON_OPTS $MGMT_OPTS $SSL_OPTS "$COMMAND_OPT"
+ $DAEMON_OPTS $MGMT_OPTS $MONITOR_OPT $SSL_OPTS "$COMMAND_OPT"
if running; then
echo "$NAME."
else
check_op "Removing $netdev from datapath" dpctl delif nl:0 $netdev
done
check_op "Deleting datapath" dpctl deldp nl:0
+ check_op "Unloading kernel module" modprobe -r openflow_mod
;;
force-stop)
echo -n "Forcefully stopping $DESC: "
$0 start
;;
status)
- echo -n "$LABEL is "
+ echo -n "$NAME is "
if running ; then
echo "running"
else