X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=rhel%2Fetc_init.d_openvswitch;h=a25e624029d2db37e852ce11a5e5c774b27081c4;hb=5ca1ba484bd9ade5116a49cf241cb98219d7d696;hp=c7543cc5517be88d5e30f0f3a37c6fad53071462;hpb=c434706a374bd44d1274e7bdbee40067a6620b61;p=sliver-openvswitch.git diff --git a/rhel/etc_init.d_openvswitch b/rhel/etc_init.d_openvswitch index c7543cc55..a25e62402 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 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,13 +27,10 @@ # Short-Description: Open vSwitch switch ### END INIT INFO -. /usr/share/openvswitch/scripts/ovs-lib.sh || exit 1 +. /usr/share/openvswitch/scripts/ovs-lib || exit 1 test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch start () { - # Allow GRE traffic. - /sbin/iptables -I INPUT -p gre -j ACCEPT - set $ovs_ctl ${1-start} set "$@" --system-id=random if test X"$FORCE_COREFILES" != X; then @@ -48,12 +45,11 @@ start () { if test X"$VSWITCHD_MLOCKALL" != X; then set "$@" --mlockall="$VSWITCHD_MLOCKALL" fi - if test ! -e /var/run/openvswitch.booted; then - touch /var/run/openvswitch.booted - set "$@" --delete-bridges - fi + set "$@" $OVS_CTL_OPTS "$@" + $ovs_ctl --protocol=gre enable-protocol + touch /var/lock/subsys/openvswitch } @@ -62,6 +58,15 @@ stop () { rm -f /var/lock/subsys/openvswitch } +restart () { + if [ "$1" = "--save-flows=yes" ]; then + start restart + else + stop + start + fi +} + ovs_ctl=/usr/share/openvswitch/scripts/ovs-ctl case $1 in start) @@ -71,8 +76,8 @@ case $1 in stop ;; restart) - stop - start + shift + restart "$@" ;; reload|force-reload) # Nothing to do.