function reload_vswitchd {
if [ -f "$VSWITCHD_PIDFILE" ]; then
- "$appctl" \
- --target=ovs-vswitchd.$(cat "$VSWITCHD_PIDFILE").ctl \
- --execute=vswitchd/reload
+ "$appctl" --target=/var/run/ovs-vswitchd.`cat $VSWITCHD_PIDFILE`.ctl vswitchd/reload
fi
}
function reload_brcompatd {
if [ -f "$BRCOMPATD_PIDFILE" ]; then
- "$appctl" \
- --target=ovs-brcompatd.$(cat "$BRCOMPATD_PIDFILE").ctl --reopen
+ "$appctl" --target=/var/run/ovs-brcompatd.`cat $BRCOMPATD_PIDFILE`.ctl vlog/reopen
fi
}
valgrind_opt="valgrind --log-file=$BRCOMPATD_VALGRIND_LOG $BRCOMPATD_VALGRIND_OPT"
daemonize="n"
fi
- appctl_cmd="$appctl -t /var/run/ovs-vswitchd.\`cat $VSWITCHD_PIDFILE\`.ctl -e '%s'"
+ appctl_cmd="$appctl --target=/var/run/ovs-vswitchd.\`cat $VSWITCHD_PIDFILE\`.ctl %s"
if [ "$daemonize" != "y" ]; then
# Start in background and force a "success" message
action "Starting ovs-brcompatd ($strace_opt$valgrind_opt)" true
if [ ! -e "$VSWITCHD_CONF" ]; then
warning "$VSWITCHD_CONF does not exist"
action "Creating empty $VSWITCHD_CONF" touch "$VSWITCHD_CONF"
+ elif [ ! -e /var/run/vswitch.booted ]; then
+ touch /var/run/vswitch.booted
+ /usr/bin/ovs-cfg-mod '-vANY:console:emer' -F "$VSWITCHD_CONF" \
+ '--del-match=bridge.*' \
+ '--del-match=port.*' \
+ '--del-match=bonding.*' \
+ '--del-match=iface.*' \
+ '--del-match=vlan.*.trunks=*' \
+ '--del-match=vlan.*.tag=*'
fi
start_vswitchd
if [ "${ENABLE_BRCOMPAT}" = "y" ] ; then
- start_brcompatd
+ start_brcompatd
fi
reload_vswitchd # ensures ovs-vswitchd has fully read config file.
touch /var/lock/subsys/vswitch
;;
status)
status -p ovs-vswitchd.pid ovs-vswitchd
- status -p ovs-brcompatd.pid ovs-brcompatd
+ rc=$?
+ if [ $rc -eq 0 ] && [ "$ENABLE_BRCOMPAT" = "y" ] ; then
+ status -p ovs-brcompatd.pid ovs-brcompatd
+ rc=$?
+ fi
+ exit $rc
;;
version)
/usr/sbin/ovs-vswitchd -V