diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-06-21 13:00:22 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-06-21 13:01:13 -0700 |
| commit | c434706a374bd44d1274e7bdbee40067a6620b61 (patch) | |
| tree | c01fa12d0e60306c22bd51d089e3313a4f6961bb /rhel/etc_init.d_openvswitch | |
| parent | e5b6e3ae0aa0f2bc9d7b5268822613bc228de3ac (diff) | |
| download | openvswitch-c434706a374bd44d1274e7bdbee40067a6620b61.tar.gz | |
Add RHEL 5/6 spec files and instructions.
Diffstat (limited to 'rhel/etc_init.d_openvswitch')
| -rwxr-xr-x | rhel/etc_init.d_openvswitch | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/rhel/etc_init.d_openvswitch b/rhel/etc_init.d_openvswitch new file mode 100755 index 000000000..c7543cc55 --- /dev/null +++ b/rhel/etc_init.d_openvswitch @@ -0,0 +1,96 @@ +#!/bin/sh +# +# openvswitch +# +# chkconfig: 2345 09 91 +# description: Manage Open vSwitch kernel modules and user-space daemons + +# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +### BEGIN INIT INFO +# Provides: openvswitch-switch +# Required-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Open vSwitch switch +### END INIT INFO + +. /usr/share/openvswitch/scripts/ovs-lib.sh || 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 + set "$@" --force-corefiles="$FORCE_COREFILES" + fi + if test X"$OVSDB_SERVER_PRIORITY" != X; then + set "$@" --ovsdb-server-priority="$OVSDB_SERVER_PRIORITY" + fi + if test X"$VSWITCHD_PRIORITY" != X; then + set "$@" --ovs-vswitchd-priority="$VSWITCHD_PRIORITY" + fi + 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 + "$@" + + touch /var/lock/subsys/openvswitch +} + +stop () { + $ovs_ctl stop + rm -f /var/lock/subsys/openvswitch +} + +ovs_ctl=/usr/share/openvswitch/scripts/ovs-ctl +case $1 in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload|force-reload) + # Nothing to do. + ;; + status) + $ovs_ctl status + ;; + version) + $ovs_ctl version + ;; + force-reload-kmod) + start force-reload-kmod + ;; + help) + printf "$0 [start|stop|restart|reload|force-reload|status|version|force-reload-kmod]\n" + ;; + *) + printf "Unknown command: $1\n" + exit 1 + ;; +esac |
