The default is unchanged, /etc/openvswitch/conf.db.
This makes it possible to transition each Open vSwitch packaging from
/etc/openvswitch/conf.db to /var/lib/openvswitch/conf.db independently.
Signed-off-by: Ben Pfaff <blp@nicira.com>
sed \
-e 's,[@]PKIDIR[@],$(PKIDIR),g' \
-e 's,[@]LOGDIR[@],$(LOGDIR),g' \
+ -e 's,[@]DBDIR[@],$(DBDIR),g' \
-e 's,[@]PERL[@],$(PERL),g' \
-e 's,[@]PYTHON[@],$(PYTHON),g' \
-e 's,[@]RUNDIR[@],$(RUNDIR),g' \
OVS_CHECK_PKIDIR
OVS_CHECK_RUNDIR
+OVS_CHECK_DBDIR
OVS_CHECK_BACKTRACE
OVS_CHECK_MALLOC_HOOKS
OVS_CHECK_VALGRIND
-e 's,[@]srcdir[@],$(srcdir),g' \
-e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
-e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
+ -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
-e 's,[@]bindir[@],"$(bindir)",g' \
-e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
-e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
$(MKDIR_P) $(DESTDIR)$(RUNDIR)
$(MKDIR_P) $(DESTDIR)$(PKIDIR)
$(MKDIR_P) $(DESTDIR)$(LOGDIR)
+ $(MKDIR_P) $(DESTDIR)$(DBDIR)
if !USE_LINKER_SECTIONS
# All distributed sources, with names adjust properly for referencing
#line 2 "@srcdir@/lib/dirs.c.in"
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return get_dir(&d);
}
+const char *
+ovs_dbdir(void)
+{
+ static struct directory d = { NULL, @DBDIR@, "OVS_DBDIR" };
+ return get_dir(&d);
+}
+
const char *
ovs_bindir(void)
{
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
const char *ovs_pkgdatadir(void); /* /usr/local/share/openvswitch */
const char *ovs_rundir(void); /* /usr/local/var/run/openvswitch */
const char *ovs_logdir(void); /* /usr/local/var/log/openvswitch */
+const char *ovs_dbdir(void); /* /usr/local/etc/openvswitch */
const char *ovs_bindir(void); /* /usr/local/bin */
#endif /* dirs.h */
[LOGDIR='${localstatedir}/log/${PACKAGE}'])
AC_SUBST([LOGDIR])])
+dnl Checks for the directory in which to store the Open vSwitch database.
+AC_DEFUN([OVS_CHECK_DBDIR],
+ [AC_ARG_WITH(
+ [dbdir],
+ AC_HELP_STRING([--with-dbdir=DIR],
+ [directory used for conf.db [[SYSCONFDIR/PACKAGE]]]),
+ [DBDIR=$withval],
+ [DBDIR='${sysconfdir}/${PACKAGE}'])
+ AC_SUBST([DBDIR])])
+
dnl Defines HAVE_BACKTRACE if backtrace() is declared in <execinfo.h>
dnl and exists in libc.
AC_DEFUN([OVS_CHECK_BACKTRACE],
over active or passive TCP/IP or Unix domain sockets.
.PP
The OVSDB file may be specified on the command line as \fIdatabase\fR.
-The default is \fB@sysconfdir@/openvswitch/conf.db\fR. The database
+The default is \fB@DBDIR@/conf.db\fR. The database
file must already have been created and initialized using, for
example, \fBovsdb\-tool create\fR.
.
switch (argc) {
case 0:
- *file_namep = xasprintf("%s/openvswitch/conf.db", ovs_sysconfdir());
+ *file_namep = xasprintf("%s/conf.db", ovs_dbdir());
break;
case 1:
.SS "Other Options"
.so lib/common.man
.SH "FILES"
-The default \fIdb\fR is \fB@sysconfdir@/openvswitch/conf.db\fR. The
+The default \fIdb\fR is \fB@DBDIR@/conf.db\fR. The
default \fIschema\fR is \fB@pkgdatadir@/vswitch.ovsschema\fR. The
\fBhelp\fR command also displays these defaults.
.SH "SEE ALSO"
{
static char *db;
if (!db) {
- db = xasprintf("%s/conf.db", ovs_sysconfdir());
+ db = xasprintf("%s/conf.db", ovs_dbdir());
}
return db;
}
echo 'PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """$(pkgdatadir)""")' && \
echo 'RUNDIR = os.environ.get("OVS_RUNDIR", """@RUNDIR@""")' && \
echo 'LOGDIR = os.environ.get("OVS_LOGDIR", """@LOGDIR@""")' && \
+ echo 'DBDIR = os.environ.get("OVS_DBDIR", """@DBDIR@""")' && \
echo 'BINDIR = os.environ.get("OVS_BINDIR", """$(bindir)""")') \
> python/ovs/dirs.py.tmp
$(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs
PKGDATADIR = os.environ.get("OVS_PKGDATADIR", "/usr/local/share/openvswitch")
RUNDIR = os.environ.get("OVS_RUNDIR", "/var/run")
LOGDIR = os.environ.get("OVS_LOGDIR", "/usr/local/var/log")
+LOGDIR = os.environ.get("OVS_DBDIR", "/usr/local/etc/openvswitch")
BINDIR = os.environ.get("OVS_BINDIR", "/usr/local/bin")
m4_define([OVS_VSWITCHD_START],
[OVS_RUNDIR=`pwd`; export OVS_RUNDIR
OVS_LOGDIR=`pwd`; export OVS_LOGDIR
+ OVS_DBDIR=`pwd`; export OVS_DBDIR
OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR
trap 'kill `cat ovsdb-server.pid ovs-vswitchd.pid`' 0
dnl Create database.
mkdir openvswitch
touch openvswitch/.conf.db.~lock~
- AT_CHECK([ovsdb-tool create openvswitch/conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema])
+ AT_CHECK([ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema])
dnl Start ovsdb-server.
AT_CHECK([ovsdb-server --detach --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock], [0], [], [stderr])
AT_SKIP_IF([test $HAVE_PYTHON = no])
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
+OVS_DBDIR=`pwd`; export OVS_DBDIR
OVS_PKGDATADIR=`pwd`; export OVS_PKGDATADIR
cp "$top_srcdir/vswitchd/vswitch.ovsschema" .
export PYTHONPATH
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
+OVS_DBDIR=`pwd`; export OVS_DBDIR
OVS_PKGDATADIR=`pwd`; export OVS_PKGDATADIR
cp "$top_srcdir/vswitchd/vswitch.ovsschema" .
AT_SETUP([unixctl bad target - Python])
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
+OVS_DBDIR=`pwd`; export OVS_DBDIR
AT_SKIP_IF([test $HAVE_PYTHON = no])
AT_CHECK([PYAPPCTL -t bogus doit], [1], [], [stderr])
AT_SKIP_IF([test $HAVE_PYTHON = no])
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
OVS_LOGDIR=`pwd`; export OVS_LOGDIR
+OVS_DBDIR=`pwd`; export OVS_DBDIR
OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR
trap 'kill `cat test-unixctl.py.pid`' 0
AT_CAPTURE_FILE([`pwd`/test-unixctl.py.log])
AT_SKIP_IF([test $HAVE_PYTHON = no])
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
OVS_LOGDIR=`pwd`; export OVS_LOGDIR
+OVS_DBDIR=`pwd`; export OVS_DBDIR
OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR
trap 'kill `cat test-unixctl.py.pid`' 0
AT_SKIP_IF([test $HAVE_PYTHON = no])
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
OVS_LOGDIR=`pwd`; export OVS_LOGDIR
+OVS_DBDIR=`pwd`; export OVS_DBDIR
OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR
trap 'kill `cat test-unixctl.py.pid`' 0
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
OVS_LOGDIR=`pwd`; export OVS_LOGDIR
+OVS_DBDIR=`pwd`; export OVS_DBDIR
OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR
trap 'kill `cat test-unixctl.py.pid`' 0
AT_SKIP_IF([test $HAVE_PYTHON = no])
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
OVS_LOGDIR=`pwd`; export OVS_LOGDIR
+OVS_DBDIR=`pwd`; export OVS_DBDIR
OVS_SYSCONFDIR=`pwd`; export OVS_SYSCONFDIR
trap 'kill `cat test-unixctl.py.pid`' 0
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Copyright (c) 2005, 2007 XenSource Ltd.
-# Copyright (c) 2010, 2011 Nicira, Inc.
+# Copyright (c) 2010, 2011, 2012 Nicira, Inc.
#
# To add new entries to the bugtool, you need to:
OPENVSWITCH_DEFAULT_SWITCH = '/etc/default/openvswitch-switch' # Debian
OPENVSWITCH_SYSCONFIG_SWITCH = '/etc/sysconfig/openvswitch' # RHEL
OPENVSWITCH_DEFAULT_CONTROLLER = '/etc/default/openvswitch-controller'
-OPENVSWITCH_CONF_DB = '@sysconfdir@/openvswitch/conf.db'
+OPENVSWITCH_CONF_DB = '@DBDIR@/conf.db'
OPENVSWITCH_VSWITCHD_PID = '@RUNDIR@/ovs-vswitchd.pid'
COLLECTD_LOGS_DIR = '/var/lib/collectd/rrd'
VAR_LOG_DIR = '/var/log/'
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA.
- Copyright (C) 2011 Nicira, Inc.
+ Copyright (C) 2011, 2012 Nicira, Inc.
-->
<collect>
<directory label="ovsdb-backups" filters="ovs" pattern=".*/conf.db.backup[0-9][^/]*$">/etc/openvswitch</directory>
+ <directory label="ovsdb-backups2" filters="ovs" pattern=".*/conf.db.backup[0-9][^/]*$">/var/lib/openvswitch</directory>
</collect>
.
.IP "\fBOVS_LOGDIR\fR"
.IQ "\fBOVS_RUNDIR\fR"
+.IQ "\fBOVS_DBDIR\fR"
.IQ "\fBOVS_SYSCONFDIR\fR"
.IQ "\fBOVS_PKGDATADIR\fR"
.IQ "\fBOVS_BINDIR\fR"
The OVS database schema used to initialize the database (use
\fB\-\-db\-schema to override this location).
.
-.IP "\fIsysconfdir\fB/openvswitch/conf.db\fR"
+.IP "\fIdbdir\fB/conf.db\fR"
The OVS database (use \fB\-\-db\-file\fR to override this location).
.
.IP "\fIrundir\fB/openvswitch/db.sock\fR"
OVS_VSWITCHD_WRAPPER=
OVS_BRCOMPATD_WRAPPER=
- DB_FILE=$etcdir/conf.db
+ DB_FILE=$dbdir/conf.db
DB_SOCK=$rundir/db.sock
DB_SCHEMA=$datadir/vswitch.ovsschema
-V, --version display version information
Default directories with "configure" option and environment variable override:
- logs: @LOGDIR@ (--log-dir, OVS_LOGDIR)
- pidfiles and sockets: @RUNDIR@ (--run-dir, OVS_RUNDIR)
+ logs: @LOGDIR@ (--with-logdir, OVS_LOGDIR)
+ pidfiles and sockets: @RUNDIR@ (--with-rundir, OVS_RUNDIR)
+ conf.db: @DBDIR@ (--with-dbdir, OVS_DBDIR)
system configuration: @sysconfdir@ (--sysconfdir, OVS_SYSCONFDIR)
data files: @pkgdatadir@ (--pkgdatadir, OVS_PKGDATADIR)
user binaries: @bindir@ (--bindir, OVS_BINDIR)
# All of these should be substituted by the Makefile at build time.
logdir=${OVS_LOGDIR-'@LOGDIR@'} # /var/log/openvswitch
rundir=${OVS_RUNDIR-'@RUNDIR@'} # /var/run/openvswitch
+dbdir=${OVS_DBDIR-'@DBDIR@'} # /etc/openvswitch
+ # or /var/lib/openvswitch
sysconfdir=${OVS_SYSCONFDIR-'@sysconfdir@'} # /etc
etcdir=$sysconfdir/openvswitch # /etc/openvswitch
datadir=${OVS_PKGDATADIR-'@pkgdatadir@'} # /usr/share/openvswitch