aboutsummaryrefslogtreecommitdiff
path: root/network/openvswitch-utils/rc.openvswitch
diff options
context:
space:
mode:
Diffstat (limited to 'network/openvswitch-utils/rc.openvswitch')
-rw-r--r--network/openvswitch-utils/rc.openvswitch12
1 files changed, 7 insertions, 5 deletions
diff --git a/network/openvswitch-utils/rc.openvswitch b/network/openvswitch-utils/rc.openvswitch
index 8022ae3b7431f..c173da0a921c6 100644
--- a/network/openvswitch-utils/rc.openvswitch
+++ b/network/openvswitch-utils/rc.openvswitch
@@ -13,9 +13,10 @@
#
DBCONF=/etc/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
+RUNDIR=/var/run/openvswitch
+SOCKET=$RUNDIR/db.sock
+VSPID=$RUNDIR/ovs-vswitchd.pid
+DBPID=$RUNDIR/ovsdb-server.pid
# Insert kernel driver for Open vSwitch:
/sbin/modprobe openvswitch
@@ -26,6 +27,7 @@ DBPID=/var/run/openvswitch/ovsdb-server.pid
# Start openvswitch:
openvswitch_start() {
echo "Starting openvswitch: /etc/rc.d/rc.openvswitch"
+ mkdir -p $RUNDIR
/usr/sbin/ovsdb-server /etc/openvswitch/ovs-vswitchd.conf.db --remote=punix:$SOCKET \
--detach --pidfile=$DBPID --verbose=ANY:ANY:err
/usr/bin/ovs-vsctl --no-wait --verbose=ANY:ANY:err init
@@ -37,11 +39,11 @@ openvswitch_stop() {
echo "Stopping openvswitch: /etc/rc.d/rc.openvswitch"
if [ -e $VSPID ]; then
pid=$(cat $VSPID)
- /usr/bin/ovs-appctl -t /var/run/openvswitch/ovs-vswitchd.$pid.ctl exit
+ /usr/bin/ovs-appctl -t $RUNDIR/ovs-vswitchd.$pid.ctl exit
fi
if [ -e $DBPID ]; then
pid=$(cat $DBPID)
- /usr/bin/ovs-appctl -t /var/run/openvswitch/ovsdb-server.$pid.ctl exit
+ /usr/bin/ovs-appctl -t $RUNDIR/ovsdb-server.$pid.ctl exit
fi
}