diff options
Diffstat (limited to 'network/openvswitch/rc.openvswitch')
-rw-r--r-- | network/openvswitch/rc.openvswitch | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/network/openvswitch/rc.openvswitch b/network/openvswitch/rc.openvswitch index 0fc64c127d..9d2fd75e46 100644 --- a/network/openvswitch/rc.openvswitch +++ b/network/openvswitch/rc.openvswitch @@ -6,16 +6,7 @@ # # % chmod 755 /etc/rc.d/rc.openvswitch -# Before you can run Open vSwitch daemon, you must have a database. To -# install an initial database, perform the following as root: -# -# % modprobe openvswitch_mod -# % ovsdb-tool create /etc/openvswitch/ovs-vswitchd.conf.db @DOCDIR@/schema/vswitch.ovsschema -# - -# Module to make Open vSwitch compatible with Linux bridge utils: -BRCOMPAT=0 - +DBCONF=/var/lib/openvswitch/ovs-vswitchd.conf.db SOCKET=/var/run/openvswitch/db.sock VSPID=/var/run/openvswitch/ovs-vswitchd.pid DBPID=/var/run/openvswitch/ovsdb-server.pid @@ -26,15 +17,13 @@ DBPID=/var/run/openvswitch/ovsdb-server.pid # Insert kernel driver for VLANs: /sbin/modprobe 8021q -# Insert kernel driver for bridge util compatibility: -if [ $BRCOMPAT -ne 0 ] ; then - /sbin/modprobe brcompat -fi - # Start openvswitch: openvswitch_start() { echo "Starting openvswitch: /etc/rc.d/rc.openvswitch" - /usr/sbin/ovsdb-server /etc/openvswitch/ovs-vswitchd.conf.db --remote=punix:$SOCKET --detach --pidfile=$DBPID --verbose=ANY:ANY:err + if [ ! -f $DBCONF ]; then + ovsdb-tool create $DBCONF @DOCDIR@/schema/vswitch.ovsschema + fi + /usr/sbin/ovsdb-server $DBCONF --remote=punix:$SOCKET --detach --pidfile=$DBPID --verbose=ANY:ANY:err /usr/bin/ovs-vsctl --no-wait --verbose=ANY:ANY:err init /usr/sbin/ovs-vswitchd unix:$SOCKET --detach --pidfile=$VSPID --verbose=ANY:ANY:err } |