forked from pool/openvswitch
Accepting request 107677 from home:dmacvicar:branches:network
- Rewrite the package based on the debian version instead * current package was tied to xenserver config without even requiring it * instead of one big package depending even on qt4, there are -switch, -controller, -test subpackages now OBS-URL: https://build.opensuse.org/request/show/107677 OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=7
This commit is contained in:
parent
24ccc2b149
commit
1c3f3a7814
17
README.packager
Normal file
17
README.packager
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
This package is based on the Debian openvswitch package as the
|
||||
original openvswitch package in the build service was next to useless
|
||||
due of being based on the xenserver/ directory of the sources, which
|
||||
tied the package completely to xen.
|
||||
|
||||
Also, the original package was one big package depending even on Qt4.
|
||||
This package splits in varius subpackages.
|
||||
|
||||
The xen part was removed. If it needs to be added again, it needs to
|
||||
be its subpackage.
|
||||
|
||||
TODO:
|
||||
|
||||
- [DONE] sysconfig is bogus, as the init scripts do not source it yet (uses debian defaults file)
|
||||
- pki component does not have the postun postin scripts yet
|
||||
|
@ -1,25 +0,0 @@
|
||||
diff -ruN openvswitch-1.3.0/xenserver/automake.mk openvswitch-1.3.0/xenserver/automake.mk
|
||||
--- openvswitch-1.3.0/xenserver/automake.mk 2011-11-14 19:41:33.000000000 +0100
|
||||
+++ openvswitch-1.3.0/xenserver/automake.mk 2011-12-26 02:00:39.809040879 +0100
|
||||
@@ -16,6 +16,7 @@
|
||||
xenserver/etc_profile.d_openvswitch.sh \
|
||||
xenserver/etc_xapi.d_plugins_openvswitch-cfg-update \
|
||||
xenserver/etc_xensource_scripts_vif \
|
||||
+ xenserver/etc_sysconfig_openvswitch \
|
||||
xenserver/openvswitch-xen.spec \
|
||||
xenserver/opt_xensource_libexec_InterfaceReconfigure.py \
|
||||
xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py \
|
||||
diff -ruN openvswitch-1.3.0/xenserver/etc_sysconfig_openvswitch openvswitch-1.3.0/xenserver/etc_sysconfig_openvswitch
|
||||
--- openvswitch-1.3.0/xenserver/etc_sysconfig_openvswitch 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ openvswitch-1.3.0/xenserver/etc_sysconfig_openvswitch 2011-12-26 01:57:23.778834435 +0100
|
||||
@@ -0,0 +1,10 @@
|
||||
+### Configuration options for openvswitch
|
||||
+
|
||||
+# Copyright (C) 2009, 2010 Nicira Networks, Inc.
|
||||
+#
|
||||
+# Copying and distribution of this file, with or without modification,
|
||||
+# are permitted in any medium without royalty provided the copyright
|
||||
+# notice and this notice are preserved. This file is offered as-is,
|
||||
+# without warranty of any kind.
|
||||
+
|
||||
+NETWORK_MODE=openvswitch
|
274
openvswitch-controller.init
Normal file
274
openvswitch-controller.init
Normal file
@ -0,0 +1,274 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2011 Nicira Networks Inc.
|
||||
# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org>
|
||||
#
|
||||
# This is free software; you may redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# This is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License with
|
||||
# the Debian operating system, in /usr/share/common-licenses/GPL; if
|
||||
# not, write to the Free Software Foundation, Inc., 59 Temple Place,
|
||||
# Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: openvswitch-controller
|
||||
# Required-Start: $network $local_fs $remote_fs
|
||||
# Required-Stop: $remote_fs
|
||||
# Should-Start: $named
|
||||
# Should-Stop: $null
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Open vSwitch controller
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
DAEMON=/usr/bin/ovs-controller # Introduce the server's location here
|
||||
NAME=ovs-controller # Introduce the short server's name here
|
||||
DESC=ovs-controller # Introduce a short description here
|
||||
LOGDIR=/var/log/openvswitch # Log directory to use
|
||||
|
||||
PIDFILE=/var/run/openvswitch/$NAME.pid
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
# Default options, these can be overriden by the information
|
||||
# at /etc/default/openvswitch-controller
|
||||
DAEMON_OPTS="" # Additional options given to the server
|
||||
|
||||
DODTIME=10 # Time to wait for the server to die, in seconds
|
||||
# If this value is set too low you might not
|
||||
# let some servers to die gracefully and
|
||||
# 'restart' will not work
|
||||
|
||||
LOGFILE=$LOGDIR/$NAME.log # Server logfile
|
||||
#DAEMONUSER= # User to run the daemons as. If this value
|
||||
# is set start-stop-daemon will chuid the server
|
||||
|
||||
# Include defaults if available
|
||||
default=/etc/default/openvswitch-controller
|
||||
if [ -f $default ] ; then
|
||||
. $default
|
||||
fi
|
||||
|
||||
# Check that the user exists (if we set a user)
|
||||
# Does the user exist?
|
||||
if [ -n "$DAEMONUSER" ] ; then
|
||||
if getent passwd | grep -q "^$DAEMONUSER:"; then
|
||||
# Obtain the uid and gid
|
||||
DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'`
|
||||
DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'`
|
||||
else
|
||||
log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
running_pid() {
|
||||
# Check if a given process pid's cmdline matches a given name
|
||||
pid=$1
|
||||
name=$2
|
||||
[ -z "$pid" ] && return 1
|
||||
[ ! -d /proc/$pid ] && return 1
|
||||
cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
|
||||
# Is this the expected server
|
||||
[ "$cmd" != "$name" ] && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
running() {
|
||||
# Check if the process is running looking at /proc
|
||||
# (works for all users)
|
||||
|
||||
# No pidfile, probably no daemon present
|
||||
[ ! -f "$PIDFILE" ] && return 1
|
||||
pid=`cat $PIDFILE`
|
||||
running_pid $pid $DAEMON || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
start_server() {
|
||||
if [ -z "$LISTEN" ]; then
|
||||
echo "$default: No connection methods configured, controller disabled" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d /var/run/openvswitch ]; then
|
||||
install -d -m 755 -o root -g root /var/run/openvswitch
|
||||
fi
|
||||
|
||||
SSL_OPTS=
|
||||
case $LISTEN in
|
||||
*ssl*)
|
||||
: ${PRIVKEY:=/etc/openvswitch-controller/privkey.pem}
|
||||
: ${CERT:=/etc/openvswitch-controller/cert.pem}
|
||||
: ${CACERT:=/etc/openvswitch-controller/cacert.pem}
|
||||
if test ! -e "$PRIVKEY" || test ! -e "$CERT" ||
|
||||
test ! -e "$CACERT"; then
|
||||
if test ! -e "$PRIVKEY"; then
|
||||
echo "$PRIVKEY: private key missing" >&2
|
||||
fi
|
||||
if test ! -e "$CERT"; then
|
||||
echo "$CERT: certificate for private key missing" >&2
|
||||
fi
|
||||
if test ! -e "$CACERT"; then
|
||||
echo "$CACERT: CA certificate missing" >&2
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
SSL_OPTS="--private-key=$PRIVKEY --certificate=$CERT --ca-cert=$CACERT"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Start the process using the wrapper
|
||||
if [ -z "$DAEMONUSER" ] ; then
|
||||
start-stop-daemon --start --pidfile $PIDFILE \
|
||||
--exec $DAEMON -- --detach --pidfile=$PIDFILE \
|
||||
$LISTEN $DAEMON_OPTS $SSL_OPTS
|
||||
errcode=$?
|
||||
else
|
||||
# if we are using a daemonuser then change the user id
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE \
|
||||
--chuid $DAEMONUSER --exec $DAEMON -- \
|
||||
--detach --pidfile=$PIDFILE $LISTEN $DAEMON_OPTS \
|
||||
$SSL_OPTS
|
||||
errcode=$?
|
||||
fi
|
||||
return $errcode
|
||||
}
|
||||
|
||||
stop_server() {
|
||||
# Stop the process using the wrapper
|
||||
if [ -z "$DAEMONUSER" ] ; then
|
||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
|
||||
--exec $DAEMON
|
||||
errcode=$?
|
||||
else
|
||||
# if we are using a daemonuser then look for process that match
|
||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
|
||||
--user $DAEMONUSER --exec $DAEMON
|
||||
errcode=$?
|
||||
fi
|
||||
|
||||
return $errcode
|
||||
}
|
||||
|
||||
reload_server() {
|
||||
[ ! -f "$PIDFILE" ] && return 1
|
||||
pid=`cat $PIDFILE` # This is the daemon's pid
|
||||
# Send a SIGHUP
|
||||
kill -1 $pid
|
||||
return $?
|
||||
}
|
||||
|
||||
force_stop() {
|
||||
# Force the process to die killing it manually
|
||||
[ ! -e "$PIDFILE" ] && return
|
||||
if running ; then
|
||||
kill -15 $pid
|
||||
# Is it really dead?
|
||||
sleep "$DODTIME"
|
||||
if running ; then
|
||||
kill -9 $pid
|
||||
sleep "$DODTIME"
|
||||
if running ; then
|
||||
echo "Cannot kill $NAME (pid=$pid)!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC " "$NAME"
|
||||
# Check if it's running first
|
||||
if running ; then
|
||||
log_progress_msg "apparently already running"
|
||||
log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
if start_server && running ; then
|
||||
# It's ok, the server started and is running
|
||||
log_end_msg 0
|
||||
else
|
||||
# Either we could not start it or it is not running
|
||||
# after we did
|
||||
# NOTE: Some servers might die some time after they start,
|
||||
# this code does not try to detect this and might give
|
||||
# a false positive (use 'status' for that)
|
||||
log_end_msg 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
if running ; then
|
||||
# Only stop the server if we see it running
|
||||
stop_server
|
||||
log_end_msg $?
|
||||
else
|
||||
# If it's not running don't do anything
|
||||
log_progress_msg "apparently not running"
|
||||
log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
force-stop)
|
||||
# First try to stop gracefully the program
|
||||
$0 stop
|
||||
if running; then
|
||||
# If it's still running try to kill it more forcefully
|
||||
log_daemon_msg "Stopping (force) $DESC" "$NAME"
|
||||
force_stop
|
||||
log_end_msg $?
|
||||
fi
|
||||
;;
|
||||
restart|force-reload)
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
stop_server
|
||||
# Wait some sensible amount, some server need this
|
||||
[ -n "$DODTIME" ] && sleep $DODTIME
|
||||
start_server
|
||||
running
|
||||
log_end_msg $?
|
||||
;;
|
||||
status)
|
||||
|
||||
log_daemon_msg "Checking status of $DESC" "$NAME"
|
||||
if running ; then
|
||||
log_progress_msg "running"
|
||||
log_end_msg 0
|
||||
else
|
||||
log_progress_msg "apparently not running"
|
||||
log_end_msg 1
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
# Use this if the daemon cannot reload
|
||||
reload)
|
||||
log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
|
||||
log_warning_msg "cannot re-read the config file (use restart)."
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/openvswitch-controller
|
||||
echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
187
openvswitch-ipsec.init
Normal file
187
openvswitch-ipsec.init
Normal file
@ -0,0 +1,187 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org>
|
||||
#
|
||||
# This is free software; you may redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# This is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License with
|
||||
# the Debian operating system, in /usr/share/common-licenses/GPL; if
|
||||
# not, write to the Free Software Foundation, Inc., 59 Temple Place,
|
||||
# Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: openvswitch-ipsec
|
||||
# Required-Start: $network $local_fs $remote_fs openvswitch-switch
|
||||
# Required-Stop: $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Open vSwitch GRE-over-IPsec daemon
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
DAEMON=/usr/share/openvswitch/scripts/ovs-monitor-ipsec # Daemon's location
|
||||
NAME=ovs-monitor-ipsec # Introduce the short server's name here
|
||||
LOGDIR=/var/log/openvswitch # Log directory to use
|
||||
|
||||
PIDFILE=/var/run/openvswitch/$NAME.pid
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DODTIME=10 # Time to wait for the server to die, in seconds
|
||||
# If this value is set too low you might not
|
||||
# let some servers to die gracefully and
|
||||
# 'restart' will not work
|
||||
|
||||
set -e
|
||||
|
||||
running_pid() {
|
||||
# Check if a given process pid's cmdline matches a given name
|
||||
pid=$1
|
||||
name=$2
|
||||
[ -z "$pid" ] && return 1
|
||||
[ ! -d /proc/$pid ] && return 1
|
||||
cmd=`cat /proc/$pid/cmdline | tr "\000" " "|cut -d " " -f 2`
|
||||
# Is this the expected server
|
||||
[ "$cmd" != "$name" ] && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
running() {
|
||||
# Check if the process is running looking at /proc
|
||||
# (works for all users)
|
||||
|
||||
# No pidfile, probably no daemon present
|
||||
[ ! -f "$PIDFILE" ] && return 1
|
||||
pid=`cat $PIDFILE`
|
||||
running_pid $pid $DAEMON || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
start_server() {
|
||||
if [ ! -d /var/run/openvswitch ]; then
|
||||
install -d -m 755 -o root -g root /var/run/openvswitch
|
||||
fi
|
||||
|
||||
/usr/share/openvswitch/scripts/ovs-monitor-ipsec \
|
||||
--pidfile=$PIDFILE --log-file --detach --monitor \
|
||||
unix:/var/run/openvswitch/db.sock
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
stop_server() {
|
||||
if [ -e $PIDFILE ]; then
|
||||
kill `cat $PIDFILE`
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
force_stop() {
|
||||
# Force the process to die killing it manually
|
||||
[ ! -e "$PIDFILE" ] && return
|
||||
if running ; then
|
||||
kill -15 $pid
|
||||
# Is it really dead?
|
||||
sleep "$DODTIME"
|
||||
if running ; then
|
||||
kill -9 $pid
|
||||
sleep "$DODTIME"
|
||||
if running ; then
|
||||
echo "Cannot kill $NAME (pid=$pid)!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $NAME"
|
||||
# Check if it's running first
|
||||
if running ; then
|
||||
log_progress_msg "apparently already running"
|
||||
log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
if start_server && running ; then
|
||||
# It's ok, the server started and is running
|
||||
log_end_msg 0
|
||||
else
|
||||
# Either we could not start it or it is not running
|
||||
# after we did
|
||||
# NOTE: Some servers might die some time after they start,
|
||||
# this code does not try to detect this and might give
|
||||
# a false positive (use 'status' for that)
|
||||
log_end_msg 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $NAME"
|
||||
if running ; then
|
||||
# Only stop the server if we see it running
|
||||
stop_server
|
||||
log_end_msg $?
|
||||
else
|
||||
# If it's not running don't do anything
|
||||
log_progress_msg "apparently not running"
|
||||
log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
force-stop)
|
||||
# First try to stop gracefully the program
|
||||
$0 stop
|
||||
if running; then
|
||||
# If it's still running try to kill it more forcefully
|
||||
log_daemon_msg "Stopping (force) $NAME"
|
||||
force_stop
|
||||
log_end_msg $?
|
||||
fi
|
||||
;;
|
||||
restart|force-reload)
|
||||
log_daemon_msg "Restarting $NAME"
|
||||
stop_server
|
||||
# Wait some sensible amount, some server need this
|
||||
[ -n "$DODTIME" ] && sleep $DODTIME
|
||||
start_server
|
||||
running
|
||||
log_end_msg $?
|
||||
;;
|
||||
status)
|
||||
log_daemon_msg "Checking status of $NAME"
|
||||
if running ; then
|
||||
log_progress_msg "running"
|
||||
log_end_msg 0
|
||||
else
|
||||
log_progress_msg "apparently not running"
|
||||
log_end_msg 1
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
# Use this if the daemon cannot reload
|
||||
reload)
|
||||
log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
|
||||
log_warning_msg "cannot re-read the config file (use restart)."
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/openvswitch-ipsec
|
||||
echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
102
openvswitch-switch.init
Normal file
102
openvswitch-switch.init
Normal file
@ -0,0 +1,102 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 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: $network $named $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Open vSwitch switch
|
||||
### END INIT INFO
|
||||
|
||||
(test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0
|
||||
|
||||
. /usr/share/openvswitch/scripts/ovs-lib
|
||||
test -e /etc/sysconfig/openvswitch-switch && . /etc/sysconfig/openvswitch-switch
|
||||
|
||||
if test X"$BRCOMPAT" = Xyes && test ! -x /usr/sbin/ovs-brcompatd; then
|
||||
BRCOMPAT=no
|
||||
log_warning_msg "ovs-brcompatd missing, disabling bridge compatibility"
|
||||
fi
|
||||
|
||||
ovs_ctl () {
|
||||
set /usr/share/openvswitch/scripts/ovs-ctl "$@"
|
||||
if test X"$BRCOMPAT" = Xyes; then
|
||||
set "$@" --brcompat
|
||||
fi
|
||||
"$@"
|
||||
}
|
||||
|
||||
load_kmod () {
|
||||
ovs_ctl load-kmod || exit $?
|
||||
}
|
||||
|
||||
start () {
|
||||
if ovs_ctl load-kmod; then
|
||||
:
|
||||
else
|
||||
echo "Module has probably not been built for this kernel."
|
||||
if ! test -d /usr/share/doc/openvswitch-datapath-source; then
|
||||
echo "Install the openvswitch-datapath-source package, then read"
|
||||
else
|
||||
echo "For instructions, read"
|
||||
fi
|
||||
echo "/usr/share/doc/openvswitch-datapath-source/README.Debian"
|
||||
fi
|
||||
set ovs_ctl ${1-start} --system-id=random
|
||||
if test X"$FORCE_COREFILES" != X; then
|
||||
set "$@" --force-corefiles="$FORCE_COREFILES"
|
||||
fi
|
||||
"$@" || exit $?
|
||||
|
||||
ovs_ctl --protocol=gre enable-protocol
|
||||
}
|
||||
|
||||
stop () {
|
||||
ovs_ctl stop
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop | force-stop)
|
||||
stop
|
||||
;;
|
||||
reload | force-reload)
|
||||
# The OVS daemons keep up-to-date.
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
status)
|
||||
ovs_ctl status
|
||||
;;
|
||||
force-reload-kmod)
|
||||
start force-reload-kmod
|
||||
;;
|
||||
load-kmod)
|
||||
load_kmod
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop|force-reload-kmod|load-kmod}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
17
openvswitch-switch.logrotate
Normal file
17
openvswitch-switch.logrotate
Normal file
@ -0,0 +1,17 @@
|
||||
/var/log/openvswitch/*.log {
|
||||
daily
|
||||
compress
|
||||
create 640 root adm
|
||||
delaycompress
|
||||
missingok
|
||||
rotate 30
|
||||
postrotate
|
||||
# Tell Open vSwitch daemons to reopen their log files
|
||||
if [ -e /var/run/openvswitch/ovs-vswitchd.pid ]; then
|
||||
ovs-appctl --t ovs-vswitchd vlog/reopen
|
||||
fi
|
||||
if [ -e /var/run/openvswitch/ovsdb-server.pid ]; then
|
||||
ovs-appctl --t ovsdb-server vlog/reopen
|
||||
fi
|
||||
endscript
|
||||
}
|
8
openvswitch-switch.template
Normal file
8
openvswitch-switch.template
Normal file
@ -0,0 +1,8 @@
|
||||
# This is a POSIX shell fragment -*- sh -*-
|
||||
|
||||
# FORCE_COREFILES: If 'yes' then core files will be enabled.
|
||||
# FORCE_COREFILES=yes
|
||||
|
||||
# BRCOMPAT: If 'yes' and the openvswitch-brcompat package is installed, then
|
||||
# Linux bridge compatibility will be enabled.
|
||||
# BRCOMPAT=no
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 1 13:35:52 UTC 2012 - dmacvicar@suse.de
|
||||
|
||||
- Rewrite the package based on the debian version instead
|
||||
* current package was tied to xenserver config without
|
||||
even requiring it
|
||||
* instead of one big package depending even on qt4, there
|
||||
are -switch, -controller, -test subpackages now
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 20 23:39:50 UTC 2012 - on@morlock.nu
|
||||
|
||||
|
276
openvswitch.spec
276
openvswitch.spec
@ -30,8 +30,14 @@ Url: http://openswitch.org/
|
||||
Group: Productivity/Networking/System
|
||||
Source0: %name-%version.tar.bz2
|
||||
Source1: preamble
|
||||
|
||||
Source2: openvswitch-switch.init
|
||||
Source3: openvswitch-switch.template
|
||||
Source4: openvswitch-switch.logrotate
|
||||
|
||||
Source5: openvswitch-controller.init
|
||||
# PATCH-FEATURE-OPENSUSE openvswitch-1.3.0-suse.patch -- /etc/sysconfig configuration options for openvswitch
|
||||
Patch0: %name-1.3.0-suse.patch
|
||||
#Patch0: %name-1.3.0-suse.patch
|
||||
# PATCH-FEATURE-UPSTREAM openvswitch-1.1.0-stp-fwd-delay.patch -- Set STP bridge forward delay
|
||||
Patch1: %name-1.1.0-stp-fwd-delay.patch
|
||||
BuildRequires: autoconf automake libtool
|
||||
@ -85,9 +91,112 @@ BuildRequires: %kernel_module_package_buildreqs
|
||||
Kernel modules supporting the openvswitch datapath
|
||||
%endif
|
||||
|
||||
%package common
|
||||
Requires: python-argparse
|
||||
Suggests: ethtool
|
||||
Summary: Open vSwitch common components
|
||||
%description common
|
||||
openvswitch-common provides components required by both openvswitch-switch
|
||||
and openvswitch-controller.
|
||||
|
||||
Open vSwitch is a full-featured software-based Ethernet switch.
|
||||
|
||||
%package ipsec
|
||||
Summary: Open vSwitch GRE-over-IPsec support
|
||||
Requires: python
|
||||
Requires: ipsec-tools >= 0.8
|
||||
Requires: racoon >= 0.8
|
||||
Requires: openvswitch-common = %{version}
|
||||
Requires: openvswitch-switch = %{version}
|
||||
Requires: python-openvswitch = %{version}
|
||||
%description ipsec
|
||||
The ovs-monitor-ipsec script provides support for encrypting GRE
|
||||
tunnels with IPsec.
|
||||
|
||||
Open vSwitch is a full-featured software-based Ethernet switch.
|
||||
|
||||
%package switch
|
||||
#Suggests: openvswitch-datapath-module
|
||||
PreReq: %insserv_prereq %fillup_prereq
|
||||
Requires: openvswitch-common = %{version}
|
||||
Requires: module-init-tools
|
||||
Requires: procps
|
||||
Requires: uuid-runtime
|
||||
Requires: python
|
||||
Summary: Open vSwitch switch implementations
|
||||
%description switch
|
||||
openvswitch-switch provides the userspace components and utilities for
|
||||
he Open vSwitch kernel-based switch.
|
||||
|
||||
Open vSwitch is a full-featured software-based Ethernet switch.
|
||||
|
||||
%package pki
|
||||
Requires: openvswitch-common = %{version}
|
||||
Summary: Open vSwitch public key infrastructure dependency package
|
||||
%description pki
|
||||
openvswitch-pki provides PKI (public key infrastructure) support for
|
||||
Open vSwitch switches and controllers, reducing the risk of
|
||||
man-in-the-middle attacks on the Open vSwitch network infrastructure.
|
||||
|
||||
Open vSwitch is a full-featured software-based Ethernet switch.
|
||||
|
||||
%package controller
|
||||
Requires: openvswitch-common = %{version}
|
||||
Summary: Open vSwitch controller implementation
|
||||
%description controller
|
||||
The Open vSwitch controller enables OpenFlow switches that connect to it
|
||||
to act as MAC-learning Ethernet switches.
|
||||
|
||||
Open vSwitch is a full-featured software-based Ethernet switch.
|
||||
|
||||
%package brcompat
|
||||
Requires: openvswitch-switch = %{version}
|
||||
Recommends: bridge-utils
|
||||
Summary: Open vSwitch bridge compatibility support
|
||||
%description brcompat
|
||||
openvswitch-brcompat provides a way for applications that use the
|
||||
Linux bridge to gradually migrate to Open vSwitch. Programs that
|
||||
ordinarily control the Linux bridge module, such as "brctl", instead
|
||||
control the Open vSwitch kernel-based switch.
|
||||
|
||||
Once this package is installed, adding BRCOMPAT=yes in
|
||||
/etc/default/openvswitch-switch enables bridge compatibility.
|
||||
|
||||
Open vSwitch is a full-featured software-based Ethernet switch.
|
||||
|
||||
%package -n python-openvswitch
|
||||
Requires: python
|
||||
Summary: Python bindings for Open vSwitch
|
||||
%description -n python-openvswitch
|
||||
This package contains the full Python bindings for Open vSwitch database.
|
||||
|
||||
%package -n ovsdbmonitor
|
||||
Requires: python-openvswitch
|
||||
Requires: python-pyasn1
|
||||
Summary: Open vSwitch graphical monitoring tool
|
||||
%description -n ovsdbmonitor
|
||||
This package is a GUI tool for monitoring and troubleshooting local
|
||||
or remote Open vSwitch installations. It presents GUI tables that
|
||||
graphically represent an Open vSwitch kernel flow table (similar to
|
||||
"ovs-dpctl dump-flows") and Open vSwitch database contents (similar
|
||||
to "ovs-vsctl list <table>").
|
||||
|
||||
Open vSwitch is a full-featured software-based Ethernet switch.
|
||||
|
||||
%package test
|
||||
Requires: python-twisted-web
|
||||
Requires: python
|
||||
Requires: python-argparse
|
||||
Summary: Open vSwitch test package
|
||||
%description test
|
||||
This package contains utilities that are useful to diagnose
|
||||
performance and connectivity issues in Open vSwitch setup.
|
||||
|
||||
Open vSwitch is a full-featured software-based Ethernet switch.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
#%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
set -- *
|
||||
@ -136,81 +245,130 @@ pushd source
|
||||
%makeinstall
|
||||
install -d -m 755 %{buildroot}/%_sysconfdir/init.d
|
||||
install -d -m 755 %{buildroot}/var/adm/fillup-templates
|
||||
install -m 644 xenserver/etc_sysconfig_%{name} \
|
||||
%{buildroot}/var/adm/fillup-templates/sysconfig.%{name}
|
||||
install -m 755 xenserver/etc_init.d_%{name} \
|
||||
%{buildroot}/%_sysconfdir/init.d/%{name}
|
||||
install -m 755 xenserver/etc_init.d_%{name}-xapi-update \
|
||||
%{buildroot}/%_sysconfdir/init.d/%{name}-xapi-update
|
||||
|
||||
install -m 644 %SOURCE3 \
|
||||
%{buildroot}/var/adm/fillup-templates/sysconfig.%{name}-switch
|
||||
install -m 755 %SOURCE2 \
|
||||
%{buildroot}/%_sysconfdir/init.d/%{name}-switch
|
||||
install -m 755 %SOURCE5 \
|
||||
%{buildroot}/%_sysconfdir/init.d/%{name}-controller
|
||||
|
||||
|
||||
install -d -m 755 %{buildroot}/%_sysconfdir/sysconfig
|
||||
install -d -m 755 %{buildroot}/%_sysconfdir/logrotate.d
|
||||
install -m 644 xenserver/etc_logrotate.d_%{name} \
|
||||
%{buildroot}/%_sysconfdir/logrotate.d/%{name}
|
||||
|
||||
install -m 644 %SOURCE4 \
|
||||
%{buildroot}/%_sysconfdir/logrotate.d/%{name}-switch
|
||||
install -d -m 755 %{buildroot}/%_sysconfdir/profile.d
|
||||
install -m 644 xenserver/etc_profile.d_%{name}.sh \
|
||||
%{buildroot}/%_sysconfdir/profile.d/%{name}.sh
|
||||
install -d -m 755 %{buildroot}/%_sysconfdir/xapi.d/plugins
|
||||
install -m 755 xenserver/etc_xapi.d_plugins_%{name}-cfg-update \
|
||||
%{buildroot}/%_sysconfdir/xapi.d/plugins/%{name}-cfg-update
|
||||
|
||||
install -d -m 755 %{buildroot}/%{_datadir}/%{name}/scripts
|
||||
install -m 644 vswitchd/vswitch.ovsschema \
|
||||
%{buildroot}/%{_datadir}/%{name}/vswitch.ovsschema
|
||||
install -m 755 xenserver/opt_xensource_libexec_interface-reconfigure \
|
||||
%{buildroot}/%{_datadir}/%{name}/scripts/interface-reconfigure
|
||||
install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigure.py \
|
||||
%{buildroot}/%{_datadir}/%{name}/scripts/InterfaceReconfigure.py
|
||||
install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py \
|
||||
%{buildroot}/%{_datadir}/%{name}/scripts/InterfaceReconfigureBridge.py
|
||||
install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \
|
||||
%{buildroot}/%{_datadir}/%{name}/scripts/InterfaceReconfigureVswitch.py
|
||||
install -m 755 xenserver/etc_xensource_scripts_vif \
|
||||
%{buildroot}/%{_datadir}/%{name}/scripts/vif
|
||||
install -m 644 xenserver/usr_share_%{name}_scripts_sysconfig.template \
|
||||
%{buildroot}/%{_datadir}/%{name}/scripts/sysconfig.template
|
||||
install -d -m 755 %{buildroot}/%{_libdir}/xsconsole/plugins-base
|
||||
install -m 644 \
|
||||
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \
|
||||
%{buildroot}/%{_libdir}/xsconsole/plugins-base/XSFeatureVSwitch.py
|
||||
# install -m 644 xenserver/uuid.py %{buildroot}/%{_datadir}/%{name}/python
|
||||
|
||||
popd
|
||||
|
||||
%{__mkdir_p} %{buildroot}%{py_sitedir}
|
||||
mv %{buildroot}%{_datadir}/%{name}/python/* %{buildroot}%{py_sitedir}
|
||||
rmdir %{buildroot}%{_datadir}/%{name}/python
|
||||
|
||||
%clean
|
||||
%{?buildroot:%__rm -rf "%{buildroot}"}
|
||||
|
||||
%post
|
||||
%{fillup_and_insserv openvswitch}
|
||||
%post switch
|
||||
%{fillup_and_insserv openvswitch-switch}
|
||||
|
||||
%preun
|
||||
%stop_on_removal openvswitch
|
||||
%preun switch
|
||||
%stop_on_removal openvswitch-switch
|
||||
|
||||
%files
|
||||
%files brcompat
|
||||
%defattr(-,root,root)
|
||||
%{_sbindir}/ovs-brcompatd
|
||||
%{_mandir}/man8/ovs-brcompatd.8.gz
|
||||
|
||||
%files common
|
||||
%defattr(-,root,root)
|
||||
%dir %{_datadir}/openvswitch
|
||||
%doc source/AUTHORS source/DESIGN source/INSTALL.* source/NOTICE
|
||||
%doc source/REPORTING-BUGS source/PORTING
|
||||
%doc source/SubmittingPatches source/CodingStyle source/README
|
||||
%doc source/WHY-OVS source/COPYING source/README-gcov
|
||||
%_bindir/ovs*
|
||||
%_sbindir/ovs-brcompatd
|
||||
%_sbindir/ovsdb-server
|
||||
%_sbindir/ovs-vlan-bug-workaround
|
||||
%_sbindir/ovs-vswitchd
|
||||
%_sbindir/ovs-bugtool
|
||||
%_datadir/%name
|
||||
%_mandir/man1/*
|
||||
%_mandir/man5/*
|
||||
%_mandir/man8/*
|
||||
%_sysconfdir/init.d/openvswitch
|
||||
%_sysconfdir/init.d/openvswitch-xapi-update
|
||||
%config %_sysconfdir/logrotate.d/openvswitch
|
||||
%_sysconfdir/profile.d/openvswitch.sh
|
||||
%dir %_sysconfdir/xapi.d
|
||||
%dir %dir %_sysconfdir/xapi.d/plugins
|
||||
%dir %_libdir/xsconsole/
|
||||
%dir %_libdir/xsconsole/plugins-base/
|
||||
%_sysconfdir/xapi.d/plugins/openvswitch-cfg-update
|
||||
#_sysconfdir/openvswitch
|
||||
%_libdir/xsconsole/plugins-base/XSFeatureVSwitch.py
|
||||
/var/adm/fillup-templates/sysconfig.openvswitch
|
||||
%{_bindir}/ovs-appctl
|
||||
%{_bindir}/ovs-benchmark
|
||||
%{_bindir}/ovs-ofctl
|
||||
%{_bindir}/ovs-parse-leaks
|
||||
%{_bindir}/ovsdb-client
|
||||
%{_sbindir}/ovs-bugtool
|
||||
%{_sbindir}/ovs-vlan-bug-workaround
|
||||
%dir %{_datadir}/openvswitch/scripts
|
||||
%{_datadir}/openvswitch/bugtool-plugins
|
||||
%{_datadir}/openvswitch/scripts/ovs-bugtool-cfm-show
|
||||
%{_datadir}/openvswitch/scripts/ovs-bugtool-lacp-show
|
||||
%{_datadir}/openvswitch/scripts/ovs-bugtool-tc-class-show
|
||||
%{_datadir}/openvswitch/scripts/ovs-bugtool-ovsdb-dump
|
||||
%{_mandir}/man1/ovs-benchmark.1.gz
|
||||
%{_mandir}/man1/ovsdb-client.1.gz
|
||||
%{_mandir}/man8/ovs-appctl.8.gz
|
||||
%{_mandir}/man8/ovs-bugtool.8.gz
|
||||
%{_mandir}/man8/ovs-ofctl.8.gz
|
||||
%{_mandir}/man8/ovs-parse-leaks.8.gz
|
||||
%{_mandir}/man8/ovs-vlan-bug-workaround.8.gz
|
||||
|
||||
%files pki
|
||||
%{_mandir}/man8/ovs-pki.8.gz
|
||||
%{_bindir}/ovs-pki
|
||||
|
||||
%files controller
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/ovs-controller
|
||||
%{_sysconfdir}/init.d/openvswitch-controller
|
||||
%{_mandir}/man8/ovs-controller.8.gz
|
||||
|
||||
%files -n python-openvswitch
|
||||
%defattr(-,root,root)
|
||||
%dir %{py_sitedir}/ovs
|
||||
%{py_sitedir}/ovs/*
|
||||
|
||||
%files switch
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/ovs-dpctl
|
||||
%{_bindir}/ovs-pcap
|
||||
%{_bindir}/ovs-tcpundump
|
||||
%{_bindir}/ovs-vlan-test
|
||||
%{_bindir}/ovs-vsctl
|
||||
%{_bindir}/ovsdb-tool
|
||||
%{_sbindir}/ovs-vswitchd
|
||||
%{_sbindir}/ovsdb-server
|
||||
%{_datadir}/openvswitch/scripts/ovs-ctl
|
||||
%{_datadir}/openvswitch/scripts/ovs-lib
|
||||
%{_datadir}/openvswitch/scripts/ovs-save
|
||||
%{_datadir}/openvswitch/vswitch.ovsschema
|
||||
/var/adm/fillup-templates/sysconfig.openvswitch-switch
|
||||
%{_sysconfdir}/init.d/openvswitch-switch
|
||||
%{_sysconfdir}/logrotate.d/openvswitch-switch
|
||||
%{_mandir}/man8/ovs-dpctl.8.gz
|
||||
%{_mandir}/man1/ovs-pcap.1.gz
|
||||
%{_mandir}/man1/ovs-tcpundump.1.gz
|
||||
%{_mandir}/man8/ovs-vlan-test.8.gz
|
||||
%{_mandir}/man8/ovs-vsctl.8.gz
|
||||
%{_mandir}/man1/ovsdb-tool.1.gz
|
||||
%{_mandir}/man8/ovs-vswitchd.8.gz
|
||||
%{_mandir}/man1/ovsdb-server.1.gz
|
||||
%{_mandir}/man5/ovs-vswitchd.conf.db.5.gz
|
||||
%{_mandir}/man8/ovs-ctl.8.gz
|
||||
|
||||
%files test
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/ovs-test
|
||||
|
||||
%dir %{py_sitedir}/ovstest
|
||||
%{py_sitedir}/ovstest/*
|
||||
%{_mandir}/man8/ovs-test.8.gz
|
||||
|
||||
%files -n ovsdbmonitor
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/ovsdbmonitor
|
||||
%dir %{_datadir}/openvswitch/ovsdbmonitor
|
||||
%{_datadir}/openvswitch/ovsdbmonitor/*
|
||||
%{_mandir}/man1/ovsdbmonitor.1.gz
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user