]> git.proxmox.com Git - mirror_ovs.git/blame - utilities/ovs-appctl.8.in
ofctl: break the loop if ovs_pcap_read returns error
[mirror_ovs.git] / utilities / ovs-appctl.8.in
CommitLineData
064af421 1.\" -*- nroff -*-
9bccc3ff 2.so lib/ovs.tmac
d2cb6c95 3.TH ovs\-appctl 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"
064af421 4.ds PN ovs\-appctl
a9b4a41a 5.
064af421
BP
6.SH NAME
7ovs\-appctl \- utility for configuring running Open vSwitch daemons
a9b4a41a 8.
064af421 9.SH SYNOPSIS
4e312e69 10\fBovs\-appctl\fR [\fB\-\-target=\fItarget\fR | \fB\-t\fR \fItarget\fR]
c1689e19 11[\fB\-T \fIsecs\fR | \fB\-\-timeout=\fIsecs\fR]
3fbe1d30 12\fIcommand \fR[\fIarg\fR...]
064af421 13.br
c1689e19 14\fBovs\-appctl \fB\-\-help\fR
064af421 15.br
c1689e19 16\fBovs\-appctl \fB\-\-version\fR
064af421 17.SH DESCRIPTION
264ecd63
JP
18Open vSwitch daemons accept certain commands at runtime to control their
19behavior and query their settings. Every daemon accepts a common set of
300d3e95
BP
20commands documented under \fBCOMMON COMMANDS\fR below. Some daemons
21support additional commands documented in their own manpages.
264ecd63
JP
22\fBovs\-vswitchd\fR in particular accepts a number of additional
23commands documented in \fBovs\-vswitchd\fR(8).
a9b4a41a 24.PP
3fbe1d30
BP
25The \fBovs\-appctl\fR program provides a simple way to invoke these
26commands. The command to be sent is specified on \fBovs\-appctl\fR's
27command line as non-option arguments. \fBovs\-appctl\fR sends the
28command and prints the daemon's response on standard output.
a9b4a41a 29.PP
3fbe1d30 30In normal use only a single option is accepted:
3fbe1d30
BP
31.IP "\fB\-t \fItarget\fR"
32.IQ "\fB\-\-target=\fItarget\fR"
33Tells \fBovs\-appctl\fR which daemon to contact.
34.IP
35If \fItarget\fR begins with \fB/\fR it must name a Unix domain socket
36on which an Open vSwitch daemon is listening for control channel
37connections. By default, each daemon listens on a Unix domain socket
38named \fB@RUNDIR@/\fIprogram\fB.\fIpid\fB.ctl\fR, where \fIprogram\fR
39is the program's name and \fIpid\fR is its process ID. For example,
4e312e69
BP
40if \fBovs\-vswitchd\fR has PID 123, it would listen on
41\fB@RUNDIR@/ovs\-vswitchd.123.ctl\fR.
3fbe1d30
BP
42.IP
43Otherwise, \fBovs\-appctl\fR looks for a pidfile, that is, a file
44whose contents are the process ID of a running process as a decimal
45number, named \fB@RUNDIR@/\fItarget\fB.pid\fR. (The \fB\-\-pidfile\fR
46option makes an Open vSwitch daemon create a pidfile.)
47\fBovs\-appctl\fR reads the pidfile, then looks for a Unix socket
48named \fB@RUNDIR@/\fItarget\fB.\fIpid\fB.ctl\fR, where \fIpid\fR is
49replaced by the process ID read from the pidfile, and uses that file
50as if it had been specified directly as the target.
51.IP
a085daef
GS
52On Windows, \fItarget\fR can be an absolute path to a file that contains
53a localhost TCP port on which an Open vSwitch daemon is listening
54for control channel connections. By default, each daemon writes the
55TCP port on which it is listening for control connection into the file
56\fIprogram\fB.ctl\fR located inside the configured \fIOVS_RUNDIR\fR
57directory. If \fItarget\fR is not an absolute path, \fBovs\-appctl\fR
58looks for a file named \fItarget\fB.ctl\fR in the configured \fIOVS_RUNDIR\fR
59directory.
60.IP
3fbe1d30
BP
61The default target is \fBovs\-vswitchd\fR.
62.
c1689e19
BP
63.IP "\fB\-T \fIsecs\fR"
64.IQ "\fB\-\-timeout=\fIsecs\fR"
65By default, or with a \fIsecs\fR of \fB0\fR, \fBovs\-appctl\fR waits
66forever to connect to the daemon and receive a response. This option
67limits runtime to approximately \fIsecs\fR seconds. If the timeout
68expires, \fBovs\-appctl\fR exits with a \fBSIGALRM\fR signal.
69.
264ecd63
JP
70.SH COMMON COMMANDS
71Every Open vSwitch daemon supports a common set of commands, which are
72documented in this section.
7d110e96 73.
264ecd63
JP
74.SS GENERAL COMMANDS
75These commands display daemon-specific commands and the running version.
76Note that these commands are different from the \fB\-\-help\fR and
77\fB\-\-version\fR options that return information about the
78\fBovs\-appctl\fR utility itself.
79.
91a11f5b 80.IP "\fBlist-commands\fR"
264ecd63
JP
81Lists the commands supported by the target.
82.
83.IP "\fBversion\fR"
84Displays the version and compilation date of the target.
85.
86.SS LOGGING COMMANDS
87Open vSwitch has several log levels. The highest-severity log level is:
7d110e96 88.
2a3e30b2 89.IP "\fBoff\fR"
7d110e96 90No message is ever logged at this level, so setting a logging
d5460484 91destination's log level to \fBoff\fR disables logging to that destination.
7d110e96
BP
92.
93.PP
264ecd63
JP
94The following log levels, in order of descending severity, are
95available:
7d110e96 96.
2a3e30b2 97.IP "\fBemer\fR"
7d110e96 98A major failure forced a process to abort.
2a3e30b2 99.IP "\fBerr\fR"
7d110e96
BP
100A high-level operation or a subsystem failed. Attention is
101warranted.
2a3e30b2 102.IP "\fBwarn\fR"
7d110e96
BP
103A low-level operation failed, but higher-level subsystems may be able
104to recover.
2a3e30b2 105.IP "\fBinfo\fR"
7d110e96
BP
106Information that may be useful in retrospect when investigating
107a problem.
2a3e30b2 108.IP "\fBdbg\fR"
7d110e96
BP
109Information useful only to someone with intricate knowledge of the
110system, or that would commonly cause too-voluminous log output. Log
111messages at this level are not logged by default.
112.
113.PP
264ecd63
JP
114Every Open vSwitch daemon supports the following commands for examining
115and adjusting log levels.
3fbe1d30
BP
116.IP "\fBvlog/list\fR"
117Lists the known logging modules and their current levels.
118.
532e1463
AA
119.IP "\fBvlog/list-pattern\fR"
120Lists logging pattern used for each destination.
121.
2a3e30b2
BP
122.IP "\fBvlog/set\fR [\fIspec\fR]"
123Sets logging levels. Without any \fIspec\fR, sets the log level for
d5460484 124every module and destination to \fBdbg\fR. Otherwise, \fIspec\fR is a
2a3e30b2
BP
125list of words separated by spaces or commas or colons, up to one from
126each category below:
127.
128.RS
129.IP \(bu
130A valid module name, as displayed by the \fBvlog/list\fR command on
131\fBovs\-appctl\fR(8), limits the log level change to the specified
132module.
133.
134.IP \(bu
135\fBsyslog\fR, \fBconsole\fR, or \fBfile\fR, to limit the log level
136change to only to the system log, to the console, or to a file,
137respectively.
5a6af13f
GS
138.IP
139On Windows platform, \fBsyslog\fR is accepted as a word and
140is only useful if the \fItarget\fR was started with the
141\fB\-\-syslog\-target\fR option (the word has no effect otherwise).
2a3e30b2
BP
142.
143.IP \(bu
c1a543a8 144\fBoff\fR, \fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or
2a3e30b2
BP
145\fBdbg\fR, to control the log level. Messages of the given severity
146or higher will be logged, and messages of lower severity will be
147filtered out. \fBoff\fR filters out all messages.
148.RE
149.
150.IP
151Case is not significant within \fIspec\fR.
152.IP
153Regardless of the log levels set for \fBfile\fR, logging to a file
154will not take place unless the target application was invoked with the
155\fB\-\-log\-file\fR option.
156.IP
157For compatibility with older versions of OVS, \fBany\fR is accepted as
158a word but has no effect.
3fbe1d30 159.
d5460484
GS
160.IP "\fBvlog/set PATTERN:\fIdestination\fB:\fIpattern\fR"
161Sets the log pattern for \fIdestination\fR to \fIpattern\fR. Each time a
162message is logged to \fIdestination\fR, \fIpattern\fR determines the
064af421
BP
163message's formatting. Most characters in \fIpattern\fR are copied
164literally to the log, but special escapes beginning with \fB%\fR are
165expanded as follows:
a9b4a41a 166.
064af421
BP
167.RS
168.IP \fB%A\fR
4e312e69 169The name of the application logging the message, e.g. \fBovs\-vswitchd\fR.
a9b4a41a 170.
afc9f547
HM
171.IP \fB%B\fR
172The RFC5424 syslog PRI of the message.
173.
064af421 174.IP \fB%c\fR
4e312e69 175The name of the module (as shown by \fBovs\-appctl \-\-list\fR) logging
064af421 176the message.
a9b4a41a 177.
064af421 178.IP \fB%d\fR
4e312e69 179The current date and time in ISO 8601 format (YYYY\-MM\-DD HH:MM:SS).
a9b4a41a 180.
064af421
BP
181.IP \fB%d{\fIformat\fB}\fR
182The current date and time in the specified \fIformat\fR, which takes
183the same format as the \fItemplate\fR argument to \fBstrftime\fR(3).
2b31d8e7
PI
184As an extension, any \fB#\fR characters in \fIformat\fR will be
185replaced by fractional seconds, e.g. use \fB%H:%M:%S.###\fR for the
186time to the nearest millisecond. Sub-second times are only
187approximate and currently decimal places after the third will always
188be reported as zero.
a9b4a41a 189.
b5d29991
GS
190.IP \fB%D\fR
191The current UTC date and time in ISO 8601 format (YYYY\-MM\-DD HH:MM:SS).
192.
193.IP \fB%D{\fIformat\fB}\fR
2b31d8e7
PI
194The current UTC date and time in the specified \fIformat\fR, which
195takes the same format as the \fItemplate\fR argument to
196\fBstrftime\fR(3). Supports the same extension for sub-second
197resolution as \fB%d{\fR...\fB}\fR.
b5d29991 198.
afc9f547
HM
199.IP \fB%E\fR
200The hostname of the node running the application.
201.
064af421
BP
202.IP \fB%m\fR
203The message being logged.
a9b4a41a 204.
064af421
BP
205.IP \fB%N\fR
206A serial number for this message within this run of the program, as a
207decimal number. The first message a program logs has serial number 1,
208the second one has serial number 2, and so on.
a9b4a41a 209.
064af421
BP
210.IP \fB%n\fR
211A new-line.
a9b4a41a 212.
064af421
BP
213.IP \fB%p\fR
214The level at which the message is logged, e.g. \fBDBG\fR.
a9b4a41a 215.
064af421
BP
216.IP \fB%P\fR
217The program's process ID (pid), as a decimal number.
a9b4a41a 218.
064af421
BP
219.IP \fB%r\fR
220The number of milliseconds elapsed from the start of the application
221to the time the message was logged.
a9b4a41a 222.
781dee08
BP
223.IP \fB%t\fR
224The subprogram name, that is, an identifying name for the process or
225thread that emitted the log message, such as \fBmonitor\fR for the
226process used for \fB\-\-monitor\fR or \fBmain\fR for the primary
227process or thread in a program.
228.
229.IP \fB%T\fR
230The subprogram name enclosed in parentheses, e.g. \fB(monitor)\fR, or
231the empty string for the primary process or thread in a program.
232.
064af421
BP
233.IP \fB%%\fR
234A literal \fB%\fR.
235.RE
a9b4a41a 236.
064af421
BP
237.IP
238A few options may appear between the \fB%\fR and the format specifier
239character, in this order:
a9b4a41a 240.
064af421 241.RS
4e312e69 242.IP \fB\-\fR
064af421
BP
243Left justify the escape's expansion within its field width. Right
244justification is the default.
a9b4a41a 245.
064af421
BP
246.IP \fB0\fR
247Pad the field to the field width with \fB0\fRs. Padding with spaces
248is the default.
a9b4a41a 249.
064af421
BP
250.IP \fIwidth\fR
251A number specifies the minimum field width. If the escape expands to
252fewer characters than \fIwidth\fR then it is padded to fill the field
253width. (A field wider than \fIwidth\fR is not truncated to fit.)
254.RE
a9b4a41a 255.
064af421 256.IP
b5d29991
GS
257The default pattern for console and file output is \fB%D{%Y-%m-%dT
258%H:%M:%SZ}|%05N|%c|%p|%m\fR; for syslog output, \fB%05N|%c|%p|%m\fR.
a9b4a41a 259.
f26ddb5b 260.IP
2b02d770
PS
261Daemons written in Python (e.g. \fBovs\-xapi\-sync\fR) do not allow
262control over the log pattern.
f26ddb5b 263.
d69d61c7
GS
264.IP "\fBvlog/set\fR FACILITY:\fIfacility\fR"
265Sets the RFC5424 facility of the log message. \fIfacility\fR can be one of
266\fBkern\fR, \fBuser\fR, \fBmail\fR, \fBdaemon\fR, \fBauth\fR, \fBsyslog\fR,
267\fBlpr\fR, \fBnews\fR, \fBuucp\fR, \fBclock\fR, \fBftp\fR, \fBntp\fR,
268\fBaudit\fR, \fBalert\fR, \fBclock2\fR, \fBlocal0\fR, \fBlocal1\fR,
269\fBlocal2\fR, \fBlocal3\fR, \fBlocal4\fR, \fBlocal5\fR, \fBlocal6\fR or
270\fBlocal7\fR.
271.
06380128
BP
272.IP "\fBvlog/close\fR"
273Causes the daemon to close its log file, if it is open. (Use
274\fBvlog/reopen\fR to reopen it later.)
275.
3fbe1d30 276.IP "\fBvlog/reopen\fR"
06380128
BP
277Causes the daemon to close its log file, if it is open, and then
278reopen it. (This is useful after rotating log files, to cause a new
279log file to be used.)
a9b4a41a 280.IP
064af421 281This has no effect if the target application was not invoked with the
4e312e69 282\fB\-\-log\-file\fR option.
a9b4a41a 283.
064af421 284.SH OPTIONS
a9b4a41a 285.
064af421 286.so lib/common.man
a9b4a41a 287.
064af421 288.SH "SEE ALSO"
a9b4a41a 289.
f26ddb5b 290\fBovs\-appctl\fR can control all Open vSwitch daemons, including:
3fbe1d30 291.BR ovs\-vswitchd (8),
f26ddb5b
BP
292and
293.BR ovsdb\-server (8).