In practice the default location is the only one used, so we might as well
make it easier.
any managers specified in the database itself, and to use the SSL
configuration in the database:
any managers specified in the database itself, and to use the SSL
configuration in the database:
- % ovsdb-server /usr/local/etc/openvswitch/conf.db \
- --remote=punix:/usr/local/var/run/openvswitch/db.sock \
- --remote=db:Open_vSwitch,manager_options \
- --private-key=db:SSL,private_key \
- --certificate=db:SSL,certificate \
- --bootstrap-ca-cert=db:SSL,ca_cert \
- --pidfile --detach
+ % ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \
+ --remote=db:Open_vSwitch,manager_options \
+ --private-key=db:SSL,private_key \
+ --certificate=db:SSL,certificate \
+ --bootstrap-ca-cert=db:SSL,ca_cert \
+ --pidfile --detach
(If you built Open vSwitch without SSL support, then omit
--private-key, --certificate, and --bootstrap-ca-cert.)
(If you built Open vSwitch without SSL support, then omit
--private-key, --certificate, and --bootstrap-ca-cert.)
.
.SH SYNOPSIS
\fBovsdb\-server\fR
.
.SH SYNOPSIS
\fBovsdb\-server\fR
[\fB\-\-remote=\fIremote\fR]\&...
[\fB\-\-run=\fIcommand\fR]
.so lib/daemon-syn.man
[\fB\-\-remote=\fIremote\fR]\&...
[\fB\-\-run=\fIcommand\fR]
.so lib/daemon-syn.man
vSwitch database (OVSDB). It supports JSON-RPC client connections
over active or passive TCP/IP or Unix domain sockets.
.PP
vSwitch database (OVSDB). It supports JSON-RPC client connections
over active or passive TCP/IP or Unix domain sockets.
.PP
-The name of the OVSDB file must be specified on the command line as
-\fIdatabase\fR, which must already have been created and initialized
-using, for example, \fBovsdb\-tool create\fR.
+The OVSDB file may be specified on the command line as \fIdatabase\fR.
+The default is \fB@sysconfdir@/openvswitch/conf.db\fR. The database
+file must already have been created and initialized using, for
+example, \fBovsdb\-tool create\fR.
#include "column.h"
#include "command-line.h"
#include "daemon.h"
#include "column.h"
#include "command-line.h"
#include "daemon.h"
#include "file.h"
#include "json.h"
#include "jsonrpc.h"
#include "file.h"
#include "json.h"
#include "jsonrpc.h"
if (error) {
ovs_fatal(0, "%s", ovsdb_error_to_string(error));
}
if (error) {
ovs_fatal(0, "%s", ovsdb_error_to_string(error));
}
jsonrpc = ovsdb_jsonrpc_server_create(db);
reconfigure_from_db(jsonrpc, db, &remotes);
jsonrpc = ovsdb_jsonrpc_server_create(db);
reconfigure_from_db(jsonrpc, db, &remotes);
argc -= optind;
argv += optind;
argc -= optind;
argv += optind;
+ switch (argc) {
+ case 0:
+ *file_namep = xasprintf("%s/openvswitch/conf.db", ovs_sysconfdir());
+ break;
+
+ case 1:
+ *file_namep = xstrdup(argv[0]);
+ break;
+
+ default:
ovs_fatal(0, "database file is only non-option argument; "
"use --help for usage");
ovs_fatal(0, "database file is only non-option argument; "
"use --help for usage");
- } else if (argc < 1) {
- ovs_fatal(0, "missing database file argument; use --help for usage");
-
- *file_namep = argv[0];