2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00
Commit Graph

40 Commits

Author SHA1 Message Date
Simon Horman
64624b3cf4 Debian: fail gracefully if modules can't be loaded on install
By registering an error-handler for the init script used
in openvswitch-switch.postinst and detecting if module insertion fails,
it is possible to avoid failure to install in the case where the
openvswitch_mod module is not available.

This is done without altering the behaviour that the start target
of the openvswitch-switch init script will fail if module insertion fails.

This patch also adds a friendly hint as as to why starting
openvswitch-switch has failed if it is due to failure to insert
the openvswtich_mod. This message is displayed as necessary both
on package install and other calls to the start target of the
init script.

[Ben Pfaff fixed up == to = in postinst]
2011-09-12 09:31:18 -07:00
Justin Pettit
733a287e17 debian: Fix path for ovsdb-server in init script.
Reported-by: Brad Hall <brad@nicira.com>
2011-08-01 10:44:41 -07:00
Ben Pfaff
9fc47ed759 debian: Add support for bridge compatibility.
This adds support for bridge compatibility to the generic Open vSwitch
init scripts and to the Debian packaging.

See https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/808224.
2011-07-26 10:37:28 -07:00
Ben Pfaff
b3a375f242 Avoid inserting duplicate iptables rules when restarting vswitch.
On startup, some OVS initscripts insert an iptables rule to allow GRE
traffic (because GRE support is an important OVS feature).  I noticed that,
each time I restarted OVS, this added another GRE-related rule to the
iptables chain.  This is wasteful, because each additional rule increases
the time it takes to process a packet in the IP stack.

This commit avoids the problem by inserting an iptables rule when there
isn't already an appropriate rule.  It also avoids inserting an iptables
rule if the iptables policy is ACCEPT, meaning that packets are accepted
by default; in such a case, if the GRE packet would be dropped, it is
because the system administrator made that decision explicitly.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-06-21 16:40:44 -07:00
Ben Pfaff
5ae616d638 Fix force-reload-kmod initscript command implementations.
I screwed this up in the recent conversion.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-06-20 11:46:52 -07:00
Ben Pfaff
5e77fcd36b Fix typo in "--force-corefiles" and "force-reload-kmod".
Reported-by: Andrew Evans <aevans@nicira.com>
2011-06-17 13:51:51 -07:00
Ben Pfaff
43bb5f82ec Refactor initscripts into distro-independent and distro-specific pieces.
This should make it easier to add OVS support to new distributions.
2011-06-17 12:53:52 -07:00
Ben Pfaff
c5f341ab19 ovsdb: Implement garbage collection. 2011-03-10 11:24:00 -08:00
Andrew Evans
289df16d29 ovsdb: Remove 'managers' column from 'Open vSwitch' table.
We had retained but deprecated the use of the older 'managers' column in the
'Open vSwitch' table for compatibility with applications that might still use
it, but that created more problems than it solved. This commit removes the
'managers' column from the schema, and removes all references to it from the
code, init scripts, documentation, and tests.
2011-02-18 11:09:29 -08:00
Ben Pfaff
f8186f2c81 Avoid unneeded database compaction at startup, and improve backups.
Until now, Open vSwitch "start" has always converted the database to the
current database schema.  This compacts the database, which as a side
effect throws away useful information about the transactions that were
executed to bring the database into its current state.  This can make
debugging database-related problems more difficult.

This commit changes the "start" command to only convert the database if
the database schema has changed.  It also adds the database checksum to
the backup file name, to avoid overwriting backups in the case where the
checksum changed but the developer neglected to update the version number.

I tested an earlier version of the xenserver changes but not any version
of the Debian changes.
2011-02-15 12:24:29 -08:00
Justin Pettit
78a04c9fc2 debian: Store more system information in OVSDB.
Store the OVS version in OVSDB.  Additionally, if the "lsb_release"
command is available, store information about the system type and
version.

Bug #4576
2011-02-07 13:43:42 -08:00
Justin Pettit
00a42f740f debian: Backup OVSDB db file before converting it.
The XenServer init script makes a backup before converting the OVSDB
database file.  This may be useful for debugging, so do the same on
Debian.  Also, store the schema version in the database.
2011-02-06 16:50:18 -08:00
Andrew Evans
bfd0c03968 Debian: Make ovsdb-server use manager_options column to find managers. 2011-02-02 10:30:09 -08:00
Justin Pettit
e39da21033 debian: Remove extra space in switch init script. 2011-01-28 18:51:31 -08:00
Sajjad Lateef
5f906046c2 Create /etc/openvswitch dir when package is installed.
Earlier, the /etc/openvswitch directory would get installed as part of
the init script's start sequence. However, as newer packages are added,
including some that create files in this directory during their init
script sequences, a race condition may occur.

This change ensures that the directory /etc/openvswitch is created even
before the init scripts execute. Thus, the race condition is avoided.
2010-10-15 13:41:46 -07:00
Simon Horman
f3c51ad9cc debian: Make the init script's start command idempotent
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-10-13 15:22:13 -07:00
Justin Pettit
9704460403 debian: Use DODTIME instead of DIETIME in init scripts
Brad pointed out that openvswitch-ipsec init script defined the variable
DIETIME but attempted to use it as DODTIME.  This commit uses DODTIME,
since it's the name used by the openvswitch-switch init script.  The
openvswitch-controller init script had the same issue.

As suggested by Ben, the "s" suffixes are removed from sleep commands,
since they are a GNU extension.

Reported-by: Brad Hall <brad@nicira.com>
2010-09-23 18:21:31 -07:00
Simon Horman
b9ddc6aaae debian: Dont fail init if module cant be inserted
The problem here is that the daemon is started/restarted on
package installation, but the module may not be present at that
time and (as far as I know) its bad form to fail the package installation
in that circumstance.

In keeping with the way ipvsadm handles a similar problem,
exit with a non-error exit status if the module can't be inserted.
The loud error message is still displayed.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-09-21 10:39:31 -07:00
Ben Pfaff
6b7b9d34c0 ovs-vsctl: Remove default timeout.
On overloaded XenServers the current default timeout of 5 seconds can
occasionally be reached, which causes VM startup to fail.  This commit
fixes the problem by removing the default timeout and changing each
invocation of ovs-vsctl within the tree to specify its own timeout,
if appropriate.

Bug #3573.
2010-09-17 14:37:51 -07:00
Ethan Jackson
7ac60147cd debian: Init script should put core dumps in an appropriate place
Before this commit the init script did not change the cwd of
openvswitch processes it started.  Thus, core files were created in
root directory.  This patch changes the cwd of openvswitch to
a more reasonable location.
2010-09-15 04:51:40 -07:00
Ben Pfaff
2cc906419f Wait for daemons to die in init.d script "stop" commands.
Sometimes it takes a moment for the OVS daemons to die.  When that happens,
the "start" half of "openvswitch restart" can fail when ovsdb-tool
runs, because ovsdb-server will still have the lock on the database if it
has not exited yet.  So this commit just makes the "stop" half wait for
the daemons to really die.

Bug #3369.
2010-08-12 11:15:20 -07:00
Justin Pettit
366d78fd92 debian: Correct naming in init scripts
A number of the init scripts assumed that the package name was the same
as the binary, which is not always true.  This fixes those issues as
well as some incorrect names in usage messages.

Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
2010-06-28 14:14:08 -07:00
Jesse Gross
6f643e4946 tunneling: Remove old GRE implementation.
The new GRE implementation provides a complete drop in replacement
for the old Linux based implementation.  Therefore, remove the
old implementation and rename "grenew" to "gre".
2010-04-19 09:11:58 -04:00
Justin Pettit
9b094b09bd debian: Add $remote_fs to Required-Start/-Stop field in init scripts
Init scripts that depend on items in /usr must have $remote_fs defined
in their Required-Start and Required-Stop fields.  This will ensure that
/usr is mounted before a start or stop call is made.

Found by Lintian.
2010-03-31 23:14:04 -07:00
Justin Pettit
24e81092a1 debian: Bring Debian packaging in-line with new file locations
This commit brings the Debian packaging in-line with the similar changes
that were made to XenServer in commit bc39196.
2010-03-31 23:14:00 -07:00
Justin Pettit
bc39196036 Cleanup default file locations and XenServer packaging
This commit cleans up the locations of a number of files and directories
used.  These include:

    - Config file lives in /etc/openvswitch/conf.db
    - Logs go into /var/log/openvswitch
    - ovsdb-server socket is /var/run/openvswitch/db.sock
    - Schema goes into /usr/share/openvswitch/vswitch.ovsschema
    - PID files go in /var/run/openvswitch

For XenServer, these additional changes are made:

    - Cores go in /var/xen/openvswitch
    - OVS binaries run in /var/xen/openvswitch

In addition, it attempts to cleanup the XenServer packaging.  This
includes referring to the project as "openvswitch" as opposed to the
somewhat presumptuous "vswitch".

Note: Changes to the Debian packaging will be forthcoming.
2010-03-26 14:40:31 -07:00
Ben Pfaff
78876719e0 ovsdb-server: Obtain SSL configuration from database.
ovsdb-server should be able to obtain its SSL configuration from the
database that it is serving out, instead of having to specify it on the
command line.  This commit makes it so.
2010-03-19 16:47:11 -07:00
Ben Pfaff
f479c2f42b debian: Upgrade database before starting ovsdb-server.
The XenServer init script has been upgrading the database before starting
ovsdb-server for some time now, but the corresponding change was never
made to the Debian init script.  This commit fixes that.
2010-03-17 11:02:41 -07:00
Ben Pfaff
f78b38e901 Fix references to vswitch-idl.ovsschema to refer to vswitch.ovsschema. 2010-01-26 11:46:43 -08:00
Ben Pfaff
f3ac83df5c Enable daemon monitoring and automatic restart by default.
Tested on a XenServer by running "kill -SEGV" on the daemon processes and
watching them restart automatically and by running plain "kill" and
watching them terminate normally.
2010-01-15 15:29:54 -08:00
Justin Pettit
f20bbd7ad2 debian: Fix tab/space issues 2010-01-11 16:11:09 -08:00
Justin Pettit
6b739e5403 debian: Create the config database if it doesn't exist on startup
On startup, create an empty config database if it doesn't already exist.  This
is the behavior of the XenServer init scripts.
2010-01-11 16:11:08 -08:00
Ben Pfaff
0b1fae1b73 ovsdb-server: Make database connections configurable from database itself.
Most importantly this adds a "managers" column to the vswitch database
that specifies where the ovsdb-server should connect.
2010-01-04 10:05:51 -08:00
Ben Pfaff
6c1b89ed0e debian: Don't unload kernel modules in init script on "stop" or "restart".
Unloading kernel modules will destroy all of the datapaths, which is a
drastic action.  So we are probably better off doing that only if the
user requests it explicitly.
2009-12-16 13:40:55 -08:00
Ben Pfaff
b3a4316574 debian: Change openvswitch-switch deb to use ovsdb-server and ovs-vswitchd.
This appears to work in that it creates the database on installation,
starts and stops the programs and loads and unloads the kernel modules at
the right times, but it has not been tested beyond that.
2009-12-15 13:12:00 -08:00
Jesse Gross
c3e3d2a1e7 gre: Add kernel GRE support.
This implements the kernel portion of GRE on Linux.  It consists
of a backported module that provides the GRE capabilities of 2.6.32
plus bug fixes to kernels 2.6.18+.
2009-12-07 12:48:03 -08:00
Justin Pettit
a5e54d9b6f Merge commit 'origin/citrix'
Conflicts:

	configure.ac
2009-07-28 22:16:50 -07:00
Ben Pfaff
2b35e1475e Do not try to resolve DNS for OpenFlow controllers or netflow collectors.
Until now, setting a netflow collector to a DNS name would cause
secchan to attempt to resolve that DNS name each time that the set of
netflow collectors is re-set.  For the vswitch, this is every time that
the vswitch reconfigures itself.

Unfortunately, DNS lookup within secchan cannot work as currently
implemented, because it needs both an asynchronous DNS resolver library
and in-band control updates.  Currently we have neither.  Attempting to
look up DNS anyway just hangs.

This commit disables DNS lookup entirely, and updates the documentation to
change user expectations.  DNS still won't work, but at least it won't
hang.

Bug #1609.
2009-07-21 09:49:57 -07:00
Ben Pfaff
8cd4882fd5 Rename "secchan" to "ofproto" (library) and "ovs-openflowd" (program).
These names are more meaningful, so we prefer them.
2009-07-08 10:30:42 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00