fi
done
-[ -f /var/lock/subsys/openvswitch ] || /sbin/service openvswitch start
+SERVICE_UNIT=/usr/lib/systemd/system/openvswitch-nonetwork.service
+if [ -f $SERVICE_UNIT ] && [ -x /usr/bin/systemctl ]; then
+ if ! systemctl --quiet is-active openvswitch-nonetwork.service; then
+ systemctl start openvswitch-nonetwork.service
+ fi
+else
+ if [ ! -f /var/lock/subsys/openvswitch ]; then
+ /sbin/service openvswitch start
+ fi
+fi
case "$TYPE" in
OVSBridge)
# because it remained in the OVSDB for some reason, but it won't be up.
if check_device_down "${DEVICE}"; then
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS \
- ${OVS_EXTRA+-- $OVS_EXTRA}
+ ${OVS_EXTRA+-- $OVS_EXTRA} \
+ ${STP+-- set bridge "$DEVICE" stp_enable="${STP}"}
else
OVSBRIDGECONFIGURED="yes"
fi
[ "${OVSBRIDGECONFIGURED}" != "yes" ]; then
${OTHERSCRIPT} ${CONFIG}
fi
- [ -n "${STP}" ] && ovs-vsctl --no-wait set bridge "${DEVICE}" stp_enable="${STP}"
exit 0
;;
OVSPort)
OVSIntPort)
ifup_ovs_bridge
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=internal ${OVS_EXTRA+-- $OVS_EXTRA}
- ${OTHERSCRIPT} ${CONFIG} ${2}
+ if [ -n "${OVSDHCPINTERFACES}" ]; then
+ for _iface in ${OVSDHCPINTERFACES}; do
+ /sbin/ifup ${_iface}
+ done
+ fi
+ BOOTPROTO="${OVSBOOTPROTO}" ${OTHERSCRIPT} ${CONFIG} ${2}
;;
OVSBond)
ifup_ovs_bridge
${OTHERSCRIPT} ${CONFIG} ${2}
OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
;;
+ OVSTunnel)
+ ifup_ovs_bridge
+ ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=$OVS_TUNNEL_TYPE $OVS_TUNNEL_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
+ ${OTHERSCRIPT} ${CONFIG} ${2}
+ ;;
*)
echo $"Invalid OVS interface type $TYPE"
exit 1