- Datapath administration utility: utilities/dpctl.
- - Runtime logging configuration utility: utilities/vlogconf.
-
Some less important binaries will be built also:
+ - Runtime configuration utility: utilities/ovs-appctl.
+
- Simple OpenFlow controller: utilities/ovs-controller.
- Secure channel executable: secchan/secchan.
- ovs-controller, a simple OpenFlow switch
- - vlogconf, a utility that can adjust the logging levels of a
- running secchan, ovs-controller, or vswitchd.
+ - vlog-appctl, a utility that can control OpenVSwitch daemons,
+ adjusting their logging levels among other uses.
- ovs-pki, a utility for creating and managing the public-key
infrastructure for OpenFlow switches.
+_debian/utilities/ovs-appctl usr/sbin
_debian/utilities/ovs-parse-leaks usr/bin
_debian/utilities/ovs-pki usr/sbin
-_debian/utilities/vlogconf usr/sbin
-_debian/utilities/vlogconf.8
+_debian/utilities/ovs-appctl.8
_debian/utilities/ovs-pki.8
missingok
rotate 30
postrotate
- vlogconf --target /var/run/secchan.pid --reopen
+ ovs-appctl --target /var/run/secchan.pid --reopen
endscript
}
*
* A program that (optionally) daemonizes itself should call this function
* *after* daemonization, so that the socket name contains the pid of the
- * daemon instead of the pid of the program that exited. (Otherwise, "vlogconf
- * --target <program>.pid" will fail.)
+ * daemon instead of the pid of the program that exited. (Otherwise,
+ * "ovs-appctl --target <program>.pid" will fail.)
*
* Returns 0 if successful, otherwise a positive errno value. If successful,
* sets '*serverp' to the new unixctl_server, otherwise to NULL. */
.RS
.IP \(bu
\fImodule\fR may be any valid module name (as displayed by the
-\fB--list\fR action on \fBvlogconf\fR(8)), or the special name
+\fB--list\fR action on \fBovs-appctl\fR(8)), or the special name
\fBANY\fR to set the logging levels for all modules.
.IP \(bu
.TP
\fB-vPATTERN:\fIfacility\fB:\fIpattern\fR, \fB--verbose=PATTERN:\fIfacility\fB:\fIpattern\fR
Sets the log pattern for \fIfacility\fR to \fIpattern\fR. Refer to
-\fBvlogconf\fR(8) for a description of the valid syntax for \fIpattern\fR.
+\fBovs-appctl\fR(8) for a description of the valid syntax for \fIpattern\fR.
.TP
\fB--log-file\fR[\fB=\fIfile\fR]
die_if_already_running();
daemonize();
- /* Start listening for vlogconf requests. */
+ /* Start listening for ovs-appctl requests. */
error = unixctl_server_create(NULL, &unixctl);
if (error) {
ovs_fatal(error, "Could not listen for unixctl connections");
.SH "SEE ALSO"
.BR dpctl (8),
+.BR ovs\-appctl (8),
.BR ovs-discover (8),
.BR ovs\-controller (8),
.BR ovs-pki (8),
-.BR vlogconf (8),
.BR vswitchd.conf (5)
/dpctl
/dpctl.8
/nlmon
+/ovs-appctl
+/ovs-appctl.8
/ovs-cfg-mod
/ovs-cfg-mod.8
/ovs-controller
/ovs-pki
/ovs-pki-cgi
/ovs-pki.8
-/vlogconf
-/vlogconf.8
/ovs-wdt
bin_PROGRAMS += \
- utilities/vlogconf \
utilities/dpctl \
+ utilities/ovs-appctl \
utilities/ovs-cfg-mod \
utilities/ovs-controller \
utilities/ovs-discover \
EXTRA_DIST += \
utilities/dpctl.8.in \
+ utilities/ovs-appctl.8.in \
utilities/ovs-cfg-mod.8.in \
utilities/ovs-controller.8.in \
utilities/ovs-discover.8.in \
utilities/ovs-parse-leaks.in \
utilities/ovs-pki-cgi.in \
utilities/ovs-pki.8.in \
- utilities/ovs-pki.in \
- utilities/vlogconf.8.in
+ utilities/ovs-pki.in
DISTCLEANFILES += \
utilities/dpctl.8 \
+ utilities/ovs-appctl.8 \
utilities/ovs-cfg-mod.8 \
utilities/ovs-controller.8 \
utilities/ovs-discover.8 \
utilities/ovs-parse-leaks \
utilities/ovs-pki \
utilities/ovs-pki.8 \
- utilities/ovs-pki-cgi \
- utilities/vlogconf.8
+ utilities/ovs-pki-cgi
man_MANS += \
utilities/dpctl.8 \
+ utilities/ovs-appctl.8 \
utilities/ovs-cfg-mod.8 \
utilities/ovs-controller.8 \
utilities/ovs-discover.8 \
utilities/ovs-kill.8 \
- utilities/ovs-pki.8 \
- utilities/vlogconf.8
+ utilities/ovs-pki.8
utilities_dpctl_SOURCES = utilities/dpctl.c
utilities_dpctl_LDADD = lib/libopenvswitch.a $(FAULT_LIBS) $(SSL_LIBS)
-utilities_vlogconf_SOURCES = utilities/vlogconf.c
-utilities_vlogconf_LDADD = lib/libopenvswitch.a
+utilities_ovs_appctl_SOURCES = utilities/ovs-appctl.c
+utilities_ovs_appctl_LDADD = lib/libopenvswitch.a
utilities_ovs_cfg_mod_SOURCES = utilities/ovs-cfg-mod.c
utilities_ovs_cfg_mod_LDADD = lib/libopenvswitch.a
.BR vswitchd (8),
.BR secchan (8),
-.BR ovs\-controller (8),
-.BR vlogconf (8)
+.BR ovs\-appctl (8),
+.BR ovs\-controller (8)
--- /dev/null
+.\" -*- nroff -*-
+.de IQ
+. br
+. ns
+. IP "\\$1"
+..
+.TH ovs\-appctl 8 "April 2009" "OpenVSwitch" "OpenVSwitch Manual"
+.ds PN ovs\-appctl
+
+.SH NAME
+ovs\-appctl \- utility for configuring running OpenVSwitch daemons
+
+.SH SYNOPSIS
+\fBovs\-appctl\fR [\fB-h\fR | \fB--help\fR] [\fItarget\fR...] [\fIaction\fR...]
+.sp 1
+The available \fItarget\fR options are:
+.br
+[\fB-t\fR \fIpid\fR | \fB--target=\fIpid\fR]
+.sp 1
+The available \fIaction\fR options are:
+.br
+[\fB-l\fR | \fB--list\fR] [\fB-s\fR
+\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]] |
+\fB--set=\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]]
+[\fB-r\fR | \fB--reopen\fR]
+[\fB-e\fR | \fB--execute=\fIcommand\fR]
+
+.SH DESCRIPTION
+The \fBovs\-appctl\fR program connects to one or more running
+OpenVSwitch daemons (such as \fBvswitchd\fR(8)), as specified by the
+user, and sends them commands to query or modify their behavior.
+Its primary purpose is currently to adjust daemons' logging levels.
+
+\fBovs\-appctl\fR applies one or more actions to each of one or more
+target processes. Targets may be specified using:
+
+.IP "\fB-t \fIsocket\fR"
+.IQ "\fB--target=\fIsocket\fR"
+The specified \fIsocket\fR must be the name of a Unix domain socket
+for a \fBovs\-appctl\fR-controllable process. If \fIsocket\fR does not
+begin with \fB/\fR, it is treated as relative to \fB@RUNDIR@\fR.
+
+Each OpenVSwitch daemon by default creates a socket named
+\fB@RUNDIR@/\fIprogram\fB.\fIpid\fB.ctl\fR, where \fIprogram\fR is
+the program's name (such as \fBvswitchd\fR) and \fIpid\fR is the
+daemon's PID.
+
+.PP
+The available actions are:
+
+.IP "\fB-l\fR"
+.IQ "\fB--list\fR"
+Print the list of known logging modules and their current levels to
+stdout.
+
+.IP "\fB-s\fR \fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]"
+.IQ "\fB--set=\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]"
+
+Sets the logging level for \fImodule\fR in \fIfacility\fR to
+\fIlevel\fR. The \fImodule\fR may be any valid module name (as
+displayed by the \fB--list\fR option) or the special name \fBANY\fR to
+set the logging levels for all modules. The \fIfacility\fR may be
+\fBsyslog\fR or \fBconsole\fR to set the levels for logging to the
+system log or to the console, respectively, or \fBANY\fR to set the
+logging levels for both facilities. If it is omitted,
+\fIfacility\fR defaults to \fBANY\fR. The \fIlevel\fR must be one of
+\fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or \fBdbg\fR, designating the
+minimum severity of a message for it to be logged. If it is omitted,
+\fIlevel\fR defaults to \fBdbg\fR.
+
+.IP "\fB-s PATTERN:\fIfacility\fB:\fIpattern\fR"
+.IQ "\fB--set=PATTERN:\fIfacility\fB:\fIpattern\fR"
+
+Sets the log pattern for \fIfacility\fR to \fIpattern\fR. Each time a
+message is logged to \fIfacility\fR, \fIpattern\fR determines the
+message's formatting. Most characters in \fIpattern\fR are copied
+literally to the log, but special escapes beginning with \fB%\fR are
+expanded as follows:
+
+.RS
+.IP \fB%A\fR
+The name of the application logging the message, e.g. \fBsecchan\fR.
+
+.IP \fB%c\fR
+The name of the module (as shown by \fBovs\-appctl --list\fR) logging
+the message.
+
+.IP \fB%d\fR
+The current date and time in ISO 8601 format (YYYY-MM-DD HH:MM:SS).
+
+.IP \fB%d{\fIformat\fB}\fR
+The current date and time in the specified \fIformat\fR, which takes
+the same format as the \fItemplate\fR argument to \fBstrftime\fR(3).
+
+.IP \fB%m\fR
+The message being logged.
+
+.IP \fB%N\fR
+A serial number for this message within this run of the program, as a
+decimal number. The first message a program logs has serial number 1,
+the second one has serial number 2, and so on.
+
+.IP \fB%n\fR
+A new-line.
+
+.IP \fB%p\fR
+The level at which the message is logged, e.g. \fBDBG\fR.
+
+.IP \fB%P\fR
+The program's process ID (pid), as a decimal number.
+
+.IP \fB%r\fR
+The number of milliseconds elapsed from the start of the application
+to the time the message was logged.
+
+.IP \fB%%\fR
+A literal \fB%\fR.
+.RE
+
+.IP
+A few options may appear between the \fB%\fR and the format specifier
+character, in this order:
+
+.RS
+.IP \fB-\fR
+Left justify the escape's expansion within its field width. Right
+justification is the default.
+
+.IP \fB0\fR
+Pad the field to the field width with \fB0\fRs. Padding with spaces
+is the default.
+
+.IP \fIwidth\fR
+A number specifies the minimum field width. If the escape expands to
+fewer characters than \fIwidth\fR then it is padded to fill the field
+width. (A field wider than \fIwidth\fR is not truncated to fit.)
+.RE
+
+.IP
+The default pattern for console output is \fB%d{%b %d
+%H:%M:%S}|%05N|%c|%p|%m\fR; for syslog output, \fB%05N|%c|%p|%m\fR.
+
+.IP \fB-r\fR
+.IQ \fB--reopen\fR
+Causes the target application to close and reopen its log file. (This
+is useful after rotating log files, to cause a new log file to be
+used.)
+
+This has no effect if the target application was not invoked with the
+\fB--log-file\fR option.
+
+.IP "\fB-e \fIcommand\fR"
+.IQ "\fB--execute=\fIcommand\fR"
+Passes the specified \fIcommand\fR literally to the target application
+and prints its response to stdout, if successful, or to stderr if an
+error occurs. Use \fB-e help\fR to print a list of available commands.
+
+.SH OPTIONS
+
+.so lib/common.man
+
+.SH "SEE ALSO"
+
+.BR dpctl (8),
+.BR secchan (8),
+.BR ovs\-controller (8)
--- /dev/null
+/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford
+ * Junior University
+ *
+ * We are making the OpenFlow specification and associated documentation
+ * (Software) available for public use and benefit with the expectation
+ * that others will use, modify and enhance the Software and contribute
+ * those enhancements back to the community. However, since we would
+ * like to make the Software available for broadest use, with as few
+ * restrictions as possible permission is hereby granted, free of
+ * charge, to any person obtaining a copy of this Software to deal in
+ * the Software under the copyrights without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The name and trademarks of copyright holder(s) may NOT be used in
+ * advertising or publicity pertaining to the Software or any
+ * derivatives without specific, written prior permission.
+ */
+#include <config.h>
+#include "vlog.h"
+
+#include <dirent.h>
+#include <errno.h>
+#include <getopt.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "command-line.h"
+#include "compiler.h"
+#include "timeval.h"
+#include "unixctl.h"
+#include "util.h"
+
+static void
+usage(char *prog_name, int exit_code)
+{
+ printf("Usage: %s [TARGET] [ACTION...]\n"
+ "Targets:\n"
+ " -t, --target=TARGET Path to Unix domain socket\n"
+ "Actions:\n"
+ " -l, --list List current settings\n"
+ " -s, --set=MODULE[:FACILITY[:LEVEL]]\n"
+ " Set MODULE and FACILITY log level to LEVEL\n"
+ " MODULE may be any valid module name or 'ANY'\n"
+ " FACILITY may be 'syslog', 'console', 'file', or 'ANY' (default)\n"
+ " LEVEL may be 'emer', 'err', 'warn', 'info', or 'dbg' (default)\n"
+ " -r, --reopen Make the program reopen its log file\n"
+ " -e, --execute=COMMAND Execute control COMMAND and print its output\n"
+ " -h, --help Print this helpful information\n",
+ prog_name);
+ exit(exit_code);
+}
+
+static char *
+transact(struct unixctl_client *client, const char *request, bool *ok)
+{
+ int code;
+ char *reply;
+ int error = unixctl_client_transact(client, request, &code, &reply);
+ if (error) {
+ fprintf(stderr, "%s: transaction error: %s\n",
+ unixctl_client_target(client), strerror(error));
+ *ok = false;
+ return xstrdup("");
+ } else {
+ if (code / 100 != 2) {
+ fprintf(stderr, "%s: server returned reply code %03d\n",
+ unixctl_client_target(client), code);
+ }
+ return reply;
+ }
+}
+
+static void
+transact_ack(struct unixctl_client *client, const char *request, bool *ok)
+{
+ free(transact(client, request, ok));
+}
+
+static void
+execute_command(struct unixctl_client *client, const char *request, bool *ok)
+{
+ int code;
+ char *reply;
+ int error = unixctl_client_transact(client, request, &code, &reply);
+ if (error) {
+ fprintf(stderr, "%s: transaction error: %s\n",
+ unixctl_client_target(client), strerror(error));
+ *ok = false;
+ } else {
+ if (code / 100 != 2) {
+ fprintf(stderr, "%s: server returned reply code %03d\n",
+ unixctl_client_target(client), code);
+ fputs(reply, stderr);
+ *ok = false;
+ } else {
+ fputs(reply, stdout);
+ }
+ }
+}
+
+static void
+add_target(struct unixctl_client ***clients, size_t *n_clients,
+ const char *path, bool *ok)
+{
+ struct unixctl_client *client;
+ int error = unixctl_client_create(path, &client);
+ if (error) {
+ fprintf(stderr, "Error connecting to \"%s\": %s\n",
+ path, strerror(error));
+ *ok = false;
+ } else {
+ *clients = xrealloc(*clients, sizeof *clients * (*n_clients + 1));
+ (*clients)[*n_clients] = client;
+ ++*n_clients;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ static const struct option long_options[] = {
+ /* Target options must come first. */
+ {"target", required_argument, NULL, 't'},
+ {"help", no_argument, NULL, 'h'},
+
+ /* Action options come afterward. */
+ {"list", no_argument, NULL, 'l'},
+ {"set", required_argument, NULL, 's'},
+ {"reopen", no_argument, NULL, 'r'},
+ {"execute", required_argument, NULL, 'e'},
+ {0, 0, 0, 0},
+ };
+ char *short_options;
+
+ /* Determine targets. */
+ bool ok = true;
+ int n_actions = 0;
+ struct unixctl_client **clients = NULL;
+ size_t n_clients = 0;
+
+ set_program_name(argv[0]);
+ time_init();
+
+ short_options = long_options_to_short_options(long_options);
+ for (;;) {
+ int option;
+ size_t i;
+
+ option = getopt_long(argc, argv, short_options, long_options, NULL);
+ if (option == -1) {
+ break;
+ }
+ if (!strchr("th", option) && n_clients == 0) {
+ ovs_fatal(0, "no targets specified (use --help for help)");
+ } else {
+ ++n_actions;
+ }
+ switch (option) {
+ case 't':
+ add_target(&clients, &n_clients, optarg, &ok);
+ break;
+
+ case 'l':
+ for (i = 0; i < n_clients; i++) {
+ struct unixctl_client *client = clients[i];
+ char *reply;
+
+ printf("%s:\n", unixctl_client_target(client));
+ reply = transact(client, "vlog/list", &ok);
+ fputs(reply, stdout);
+ free(reply);
+ }
+ break;
+
+ case 's':
+ for (i = 0; i < n_clients; i++) {
+ struct unixctl_client *client = clients[i];
+ char *request = xasprintf("vlog/set %s", optarg);
+ transact_ack(client, request, &ok);
+ free(request);
+ }
+ break;
+
+ case 'r':
+ for (i = 0; i < n_clients; i++) {
+ struct unixctl_client *client = clients[i];
+ char *request = xstrdup("vlog/reopen");
+ transact_ack(client, request, &ok);
+ free(request);
+ }
+ break;
+
+ case 'e':
+ for (i = 0; i < n_clients; i++) {
+ execute_command(clients[i], optarg, &ok);
+ }
+ break;
+
+ case 'h':
+ usage(argv[0], EXIT_SUCCESS);
+ break;
+
+ case '?':
+ exit(EXIT_FAILURE);
+
+ default:
+ NOT_REACHED();
+ }
+ }
+ if (!n_actions) {
+ fprintf(stderr,
+ "warning: no actions specified (use --help for help)\n");
+ }
+ exit(ok ? 0 : 1);
+}
.BR dpctl (8),
.BR secchan (8),
-.BR vlogconf (8)
+.BR ovs\-appctl (8)
+++ /dev/null
-.\" -*- nroff -*-
-.de IQ
-. br
-. ns
-. IP "\\$1"
-..
-.TH vlogconf 8 "April 2009" "OpenVSwitch" "OpenVSwitch Manual"
-.ds PN vlogconf
-
-.SH NAME
-vlogconf \- configuration utility for OpenVSwitch logging in userspace
-
-.SH SYNOPSIS
-\fBvlogconf\fR [\fB-h\fR | \fB--help\fR] [\fItarget\fR...] [\fIaction\fR...]
-.sp 1
-The available \fItarget\fR options are:
-.br
-[\fB-t\fR \fIpid\fR | \fB--target=\fIpid\fR]
-.sp 1
-The available \fIaction\fR options are:
-.br
-[\fB-l\fR | \fB--list\fR] [\fB-s\fR
-\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]] |
-\fB--set=\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]]
-[\fB-r\fR | \fB--reopen\fR]
-[\fB-e\fR | \fB--execute=\fIcommand\fR]
-
-.SH DESCRIPTION
-The \fBvlogconf\fR program configures the logging system used by
-OpenVSwitch userspace programs. The logging configuration may be modified
-while OpenVSwitch programs are running.
-
-\fBvlogconf\fR applies one or more actions to each of one or more
-target processes. Targets may be specified using:
-
-.IP "\fB-t \fIsocket\fR"
-.IQ "\fB--target=\fIsocket\fR"
-The specified \fIsocket\fR must be the name of a Unix domain socket
-for a \fBvlogconf\fR-controllable process. If \fIsocket\fR does not
-begin with \fB/\fR, it is treated as relative to \fB@RUNDIR@\fR.
-
-.PP
-The available actions are:
-
-.IP "\fB-l\fR"
-.IQ "\fB--list\fR"
-Print the list of known modules and their current logging levels to
-stdout.
-
-.IP "\fB-s\fR \fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]"
-.IQ "\fB--set=\fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]"
-
-Sets the logging level for \fImodule\fR in \fIfacility\fR to
-\fIlevel\fR. The \fImodule\fR may be any valid module name (as
-displayed by the \fB--list\fR option) or the special name \fBANY\fR to
-set the logging levels for all modules. The \fIfacility\fR may be
-\fBsyslog\fR or \fBconsole\fR to set the levels for logging to the
-system log or to the console, respectively, or \fBANY\fR to set the
-logging levels for both facilities. If it is omitted,
-\fIfacility\fR defaults to \fBANY\fR. The \fIlevel\fR must be one of
-\fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or \fBdbg\fR, designating the
-minimum severity of a message for it to be logged. If it is omitted,
-\fIlevel\fR defaults to \fBdbg\fR.
-
-.IP "\fB-s PATTERN:\fIfacility\fB:\fIpattern\fR"
-.IQ "\fB--set=PATTERN:\fIfacility\fB:\fIpattern\fR"
-
-Sets the log pattern for \fIfacility\fR to \fIpattern\fR. Each time a
-message is logged to \fIfacility\fR, \fIpattern\fR determines the
-message's formatting. Most characters in \fIpattern\fR are copied
-literally to the log, but special escapes beginning with \fB%\fR are
-expanded as follows:
-
-.RS
-.IP \fB%A\fR
-The name of the application logging the message, e.g. \fBsecchan\fR.
-
-.IP \fB%c\fR
-The name of the module (as shown by \fBvlogconf --list\fR) logging
-the message.
-
-.IP \fB%d\fR
-The current date and time in ISO 8601 format (YYYY-MM-DD HH:MM:SS).
-
-.IP \fB%d{\fIformat\fB}\fR
-The current date and time in the specified \fIformat\fR, which takes
-the same format as the \fItemplate\fR argument to \fBstrftime\fR(3).
-
-.IP \fB%m\fR
-The message being logged.
-
-.IP \fB%N\fR
-A serial number for this message within this run of the program, as a
-decimal number. The first message a program logs has serial number 1,
-the second one has serial number 2, and so on.
-
-.IP \fB%n\fR
-A new-line.
-
-.IP \fB%p\fR
-The level at which the message is logged, e.g. \fBDBG\fR.
-
-.IP \fB%P\fR
-The program's process ID (pid), as a decimal number.
-
-.IP \fB%r\fR
-The number of milliseconds elapsed from the start of the application
-to the time the message was logged.
-
-.IP \fB%%\fR
-A literal \fB%\fR.
-.RE
-
-.IP
-A few options may appear between the \fB%\fR and the format specifier
-character, in this order:
-
-.RS
-.IP \fB-\fR
-Left justify the escape's expansion within its field width. Right
-justification is the default.
-
-.IP \fB0\fR
-Pad the field to the field width with \fB0\fRs. Padding with spaces
-is the default.
-
-.IP \fIwidth\fR
-A number specifies the minimum field width. If the escape expands to
-fewer characters than \fIwidth\fR then it is padded to fill the field
-width. (A field wider than \fIwidth\fR is not truncated to fit.)
-.RE
-
-.IP
-The default pattern for console output is \fB%d{%b %d
-%H:%M:%S}|%05N|%c|%p|%m\fR; for syslog output, \fB%05N|%c|%p|%m\fR.
-
-.IP \fB-r\fR
-.IQ \fB--reopen\fR
-Causes the target application to close and reopen its log file. (This
-is useful after rotating log files, to cause a new log file to be
-used.)
-
-.IP "\fB-e \fIcommand\fR"
-.IQ "\fB--execute=\fIcommand\fR"
-Passes the specified \fIcommand\fR literally to the target application
-and prints its response to stdout, if successful, or to stderr if an
-error occurs. Use \fB-e help\fR to print a list of available commands.
-
-.SH OPTIONS
-
-.so lib/common.man
-
-.SH "SEE ALSO"
-
-.BR dpctl (8),
-.BR secchan (8),
-.BR ovs\-controller (8)
+++ /dev/null
-/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford
- * Junior University
- *
- * We are making the OpenFlow specification and associated documentation
- * (Software) available for public use and benefit with the expectation
- * that others will use, modify and enhance the Software and contribute
- * those enhancements back to the community. However, since we would
- * like to make the Software available for broadest use, with as few
- * restrictions as possible permission is hereby granted, free of
- * charge, to any person obtaining a copy of this Software to deal in
- * the Software under the copyrights without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * The name and trademarks of copyright holder(s) may NOT be used in
- * advertising or publicity pertaining to the Software or any
- * derivatives without specific, written prior permission.
- */
-#include <config.h>
-#include "vlog.h"
-
-#include <dirent.h>
-#include <errno.h>
-#include <getopt.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "command-line.h"
-#include "compiler.h"
-#include "timeval.h"
-#include "unixctl.h"
-#include "util.h"
-
-static void
-usage(char *prog_name, int exit_code)
-{
- printf("Usage: %s [TARGET] [ACTION...]\n"
- "Targets:\n"
- " -t, --target=TARGET Path to Unix domain socket\n"
- "Actions:\n"
- " -l, --list List current settings\n"
- " -s, --set=MODULE[:FACILITY[:LEVEL]]\n"
- " Set MODULE and FACILITY log level to LEVEL\n"
- " MODULE may be any valid module name or 'ANY'\n"
- " FACILITY may be 'syslog', 'console', 'file', or 'ANY' (default)\n"
- " LEVEL may be 'emer', 'err', 'warn', 'info', or 'dbg' (default)\n"
- " -r, --reopen Make the program reopen its log file\n"
- " -e, --execute=COMMAND Execute control COMMAND and print its output\n"
- " -h, --help Print this helpful information\n",
- prog_name);
- exit(exit_code);
-}
-
-static char *
-transact(struct unixctl_client *client, const char *request, bool *ok)
-{
- int code;
- char *reply;
- int error = unixctl_client_transact(client, request, &code, &reply);
- if (error) {
- fprintf(stderr, "%s: transaction error: %s\n",
- unixctl_client_target(client), strerror(error));
- *ok = false;
- return xstrdup("");
- } else {
- if (code / 100 != 2) {
- fprintf(stderr, "%s: server returned reply code %03d\n",
- unixctl_client_target(client), code);
- }
- return reply;
- }
-}
-
-static void
-transact_ack(struct unixctl_client *client, const char *request, bool *ok)
-{
- free(transact(client, request, ok));
-}
-
-static void
-execute_command(struct unixctl_client *client, const char *request, bool *ok)
-{
- int code;
- char *reply;
- int error = unixctl_client_transact(client, request, &code, &reply);
- if (error) {
- fprintf(stderr, "%s: transaction error: %s\n",
- unixctl_client_target(client), strerror(error));
- *ok = false;
- } else {
- if (code / 100 != 2) {
- fprintf(stderr, "%s: server returned reply code %03d\n",
- unixctl_client_target(client), code);
- fputs(reply, stderr);
- *ok = false;
- } else {
- fputs(reply, stdout);
- }
- }
-}
-
-static void
-add_target(struct unixctl_client ***clients, size_t *n_clients,
- const char *path, bool *ok)
-{
- struct unixctl_client *client;
- int error = unixctl_client_create(path, &client);
- if (error) {
- fprintf(stderr, "Error connecting to \"%s\": %s\n",
- path, strerror(error));
- *ok = false;
- } else {
- *clients = xrealloc(*clients, sizeof *clients * (*n_clients + 1));
- (*clients)[*n_clients] = client;
- ++*n_clients;
- }
-}
-
-int main(int argc, char *argv[])
-{
- static const struct option long_options[] = {
- /* Target options must come first. */
- {"target", required_argument, NULL, 't'},
- {"help", no_argument, NULL, 'h'},
-
- /* Action options come afterward. */
- {"list", no_argument, NULL, 'l'},
- {"set", required_argument, NULL, 's'},
- {"reopen", no_argument, NULL, 'r'},
- {"execute", required_argument, NULL, 'e'},
- {0, 0, 0, 0},
- };
- char *short_options;
-
- /* Determine targets. */
- bool ok = true;
- int n_actions = 0;
- struct unixctl_client **clients = NULL;
- size_t n_clients = 0;
-
- set_program_name(argv[0]);
- time_init();
-
- short_options = long_options_to_short_options(long_options);
- for (;;) {
- int option;
- size_t i;
-
- option = getopt_long(argc, argv, short_options, long_options, NULL);
- if (option == -1) {
- break;
- }
- if (!strchr("th", option) && n_clients == 0) {
- ovs_fatal(0, "no targets specified (use --help for help)");
- } else {
- ++n_actions;
- }
- switch (option) {
- case 't':
- add_target(&clients, &n_clients, optarg, &ok);
- break;
-
- case 'l':
- for (i = 0; i < n_clients; i++) {
- struct unixctl_client *client = clients[i];
- char *reply;
-
- printf("%s:\n", unixctl_client_target(client));
- reply = transact(client, "vlog/list", &ok);
- fputs(reply, stdout);
- free(reply);
- }
- break;
-
- case 's':
- for (i = 0; i < n_clients; i++) {
- struct unixctl_client *client = clients[i];
- char *request = xasprintf("vlog/set %s", optarg);
- transact_ack(client, request, &ok);
- free(request);
- }
- break;
-
- case 'r':
- for (i = 0; i < n_clients; i++) {
- struct unixctl_client *client = clients[i];
- char *request = xstrdup("vlog/reopen");
- transact_ack(client, request, &ok);
- free(request);
- }
- break;
-
- case 'e':
- for (i = 0; i < n_clients; i++) {
- execute_command(clients[i], optarg, &ok);
- }
- break;
-
- case 'h':
- usage(argv[0], EXIT_SUCCESS);
- break;
-
- case '?':
- exit(EXIT_FAILURE);
-
- default:
- NOT_REACHED();
- }
- }
- if (!n_actions) {
- fprintf(stderr,
- "warning: no actions specified (use --help for help)\n");
- }
- exit(ok ? 0 : 1);
-}
\fBbrcompatd\fR requires the \fBbrcompat_mod.ko\fR kernel module to be
loaded.
.SH "SEE ALSO"
+.BR ovs-appctl (8),
.BR vswitchd (8),
.BR vswitchd.conf (5),
-.BR vlogconf (8),
\fBINSTALL\fR in the OpenVSwitch distribution.
Only Linux 2.6.\fIx\fR is currently supported.
.
.SH "SEE ALSO"
+.BR ovs-appctl (8),
.BR vswitchd.conf (5),
.BR brcompatd (8),
-.BR vlogconf (8),
\fBINSTALL\fR in the OpenVSwitch distribution.
vswitchd="$VSWITCH_BASE/sbin/vswitchd"
brcompatd="$VSWITCH_BASE/sbin/brcompatd"
dpctl="$VSWITCH_BASE/bin/dpctl"
-vlogconf="$VSWITCH_BASE/bin/vlogconf"
+appctl="$VSWITCH_BASE/bin/ovs-appctl"
if [ "$ENABLE_FAKE_PROC_NET" == "y" ]; then
function reload_vswitchd {
if [ -f "$VSWITCHD_PIDFILE" ]; then
- "$vlogconf" \
+ "$appctl" \
--target=vswitchd.$(cat "$VSWITCHD_PIDFILE").ctl \
--execute=vswitchd/reload
fi
/root/vswitch/scripts/XSFeatureNiciraVSwitch.pyo
/root/vswitch/sbin/brcompatd
/root/vswitch/sbin/vswitchd
-/root/vswitch/bin/ovs-cfg-mod
/root/vswitch/bin/dpctl
-/root/vswitch/bin/vlogconf
+/root/vswitch/bin/ovs-appctl
+/root/vswitch/bin/ovs-cfg-mod
/root/vswitch/share/man/man5/vswitchd.conf.5
/root/vswitch/share/man/man8/brcompatd.8
+/root/vswitch/share/man/man8/ovs-appctl.8
/root/vswitch/share/man/man8/ovs-cfg-mod.8
/root/vswitch/share/man/man8/dpctl.8
-/root/vswitch/share/man/man8/vlogconf.8
/root/vswitch/share/man/man8/vswitchd.8