X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=rhel%2Fetc_init.d_openvswitch;h=3921aab5ebcc87d684d0cccd3144a14353e6d9aa;hb=d8ef07e70995e56005e3bc55b86cdb7d0e2066e5;hp=9f1506c38697469b96ec81d5d6313e96de287706;hpb=d422c1189901d34125cd2d46552391c333d1f647;p=cascardo%2Fovs.git diff --git a/rhel/etc_init.d_openvswitch b/rhel/etc_init.d_openvswitch index 9f1506c38..3921aab5e 100755 --- a/rhel/etc_init.d_openvswitch +++ b/rhel/etc_init.d_openvswitch @@ -5,7 +5,7 @@ # chkconfig: 2345 09 91 # description: Manage Open vSwitch kernel modules and user-space daemons -# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc. +# Copyright (C) 2009, 2010, 2011, 2013 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ### BEGIN INIT INFO -# Provides: openvswitch-switch +# Provides: openvswitch # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 @@ -31,7 +31,7 @@ test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch start () { - set $ovs_ctl ${1-start} + set ovs_ctl ${1-start} set "$@" --system-id=random if test X"$FORCE_COREFILES" != X; then set "$@" --force-corefiles="$FORCE_COREFILES" @@ -45,22 +45,26 @@ start () { if test X"$VSWITCHD_MLOCKALL" != X; then set "$@" --mlockall="$VSWITCHD_MLOCKALL" fi - if test X"$BRCOMPAT" = Xyes; then - set "$@" --brcompat - fi + set "$@" $OVS_CTL_OPTS "$@" - $ovs_ctl --protocol=gre enable-protocol - touch /var/lock/subsys/openvswitch } stop () { - $ovs_ctl stop + ovs_ctl stop rm -f /var/lock/subsys/openvswitch } -ovs_ctl=/usr/share/openvswitch/scripts/ovs-ctl +restart () { + if [ "$1" = "--save-flows=yes" ]; then + start restart + else + stop + start + fi +} + case $1 in start) start @@ -69,17 +73,18 @@ case $1 in stop ;; restart) - stop - start + shift + restart "$@" ;; reload|force-reload) # Nothing to do. ;; status) - $ovs_ctl status + ovs_ctl status + exit $? ;; version) - $ovs_ctl version + ovs_ctl version ;; force-reload-kmod) start force-reload-kmod