|
Packit |
5756e2 |
'\" t
|
|
Packit |
5756e2 |
.\" Title: nm-online
|
|
Packit |
5756e2 |
.\" Author:
|
|
Packit |
5756e2 |
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
|
|
Packit Service |
dff8e4 |
.\" Date: 03/24/2021
|
|
Packit |
5756e2 |
.\" Manual: General Commands Manual
|
|
Packit Service |
dff8e4 |
.\" Source: NetworkManager 1.31.2
|
|
Packit |
5756e2 |
.\" Language: English
|
|
Packit |
5756e2 |
.\"
|
|
Packit Service |
dff8e4 |
.TH "NM\-ONLINE" "1" "" "NetworkManager 1\&.31\&.2" "General Commands Manual"
|
|
Packit |
5756e2 |
.\" -----------------------------------------------------------------
|
|
Packit |
5756e2 |
.\" * Define some portability stuff
|
|
Packit |
5756e2 |
.\" -----------------------------------------------------------------
|
|
Packit |
5756e2 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
Packit |
5756e2 |
.\" http://bugs.debian.org/507673
|
|
Packit |
5756e2 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
Packit |
5756e2 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
Packit |
5756e2 |
.ie \n(.g .ds Aq \(aq
|
|
Packit |
5756e2 |
.el .ds Aq '
|
|
Packit |
5756e2 |
.\" -----------------------------------------------------------------
|
|
Packit |
5756e2 |
.\" * set default formatting
|
|
Packit |
5756e2 |
.\" -----------------------------------------------------------------
|
|
Packit |
5756e2 |
.\" disable hyphenation
|
|
Packit |
5756e2 |
.nh
|
|
Packit |
5756e2 |
.\" disable justification (adjust text to left margin only)
|
|
Packit |
5756e2 |
.ad l
|
|
Packit |
5756e2 |
.\" -----------------------------------------------------------------
|
|
Packit |
5756e2 |
.\" * MAIN CONTENT STARTS HERE *
|
|
Packit |
5756e2 |
.\" -----------------------------------------------------------------
|
|
Packit |
5756e2 |
.SH "NAME"
|
|
Packit |
5756e2 |
nm-online \- ask NetworkManager whether the network is connected
|
|
Packit |
5756e2 |
.SH "SYNOPSIS"
|
|
Packit |
5756e2 |
.HP \w'\fBnm\-online\fR\ 'u
|
|
Packit |
5756e2 |
\fBnm\-online\fR [\fIOPTIONS\fR...]
|
|
Packit |
5756e2 |
.SH "DESCRIPTION"
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fBnm\-online\fR
|
|
Packit |
5756e2 |
is a utility to find out whether we are online\&. It is done by asking NetworkManager about its status\&. When run,
|
|
Packit |
5756e2 |
\fBnm\-online\fR
|
|
Packit |
5756e2 |
waits until NetworkManager reports an active connection, or specified timeout expires\&. On exit, the returned status code should be checked (see the return codes below)\&.
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
This tool is not very useful to call directly\&. It is however used by
|
|
Packit |
5756e2 |
NetworkManager\-wait\-online\&.service
|
|
Packit |
5756e2 |
with
|
|
Packit |
5756e2 |
\-\-wait\-for\-startup
|
|
Packit |
5756e2 |
argument\&. This is used to delay the service and indirectly
|
|
Packit |
5756e2 |
network\-online\&.target, until networking is up\&. Don\*(Aqt order your own systemd services after
|
|
Packit |
5756e2 |
NetworkManager\-wait\-online\&.service
|
|
Packit |
5756e2 |
directly\&. Instead if necessary, order your services after
|
|
Packit |
5756e2 |
network\-online\&.target\&. Even better is to have your services react to network changes dynamically and don\*(Aqt order them with respect to
|
|
Packit |
5756e2 |
network\-online\&.target
|
|
Packit |
5756e2 |
at all\&.
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
By default, connections have the
|
|
Packit |
5756e2 |
ipv4\&.may\-fail
|
|
Packit |
5756e2 |
and
|
|
Packit |
5756e2 |
ipv6\&.may\-fail
|
|
Packit |
5756e2 |
properties set to
|
|
Packit |
5756e2 |
yes; this means that NetworkManager waits for one of the two address families to complete configuration before considering the connection activated\&. If you need a specific address family configured before
|
|
Packit |
5756e2 |
network\-online\&.target
|
|
Packit |
5756e2 |
is reached, set the corresponding
|
|
Packit |
5756e2 |
may\-fail
|
|
Packit |
5756e2 |
property to
|
|
Packit |
5756e2 |
no\&.
|
|
Packit |
5756e2 |
.SH "OPTIONS"
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fB\-h\fR | \fB\-\-help\fR
|
|
Packit |
5756e2 |
.RS 4
|
|
Packit |
5756e2 |
Print help information\&.
|
|
Packit |
5756e2 |
.RE
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fB\-q\fR | \fB\-\-quiet\fR
|
|
Packit |
5756e2 |
.RS 4
|
|
Packit |
5756e2 |
Don\*(Aqt print anything\&.
|
|
Packit |
5756e2 |
.RE
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fB\-s\fR | \fB\-\-wait\-for\-startup\fR
|
|
Packit |
5756e2 |
.RS 4
|
|
Packit |
5756e2 |
Wait for NetworkManager startup to complete, rather than waiting for network connectivity specifically\&. Startup is considered complete once NetworkManager has activated (or attempted to activate) every auto\-activate connection which is available given the current network state\&. This corresponds to the moment when NetworkManager logs
|
|
Packit |
5756e2 |
"startup complete"\&. This mode is generally only useful at boot time\&. After startup has completed,
|
|
Packit |
5756e2 |
\fBnm\-online \-s\fR
|
|
Packit |
5756e2 |
will just return immediately, regardless of the current network state\&.
|
|
Packit |
5756e2 |
.sp
|
|
Packit |
5756e2 |
There are various ways to affect when startup complete is reached\&. For example, by setting a connection profile to autoconnect, such a profile possibly will activate during startup and thus delay startup complete being reached\&. Also, a profile is considered ready when it fully reached the logical
|
|
Packit |
5756e2 |
connected
|
|
Packit |
5756e2 |
state in NetworkManager\&. That means, properties like
|
|
Packit |
5756e2 |
ipv4\&.may\-fail
|
|
Packit |
5756e2 |
and
|
|
Packit |
5756e2 |
ipv6\&.may\-fail
|
|
Packit |
5756e2 |
affect whether a certain address family is required\&. Also, the connection property
|
|
Packit |
5756e2 |
connection\&.wait\-device\-timeout
|
|
Packit |
5756e2 |
affects whether to wait for the driver to detect a certain device\&. Generally, a failure of
|
|
Packit |
5756e2 |
NetworkManager\-wait\-online\&.service
|
|
Packit |
5756e2 |
indicates a configuration error, where NetworkManager won\*(Aqt be able to reach the desired connectivity state during startup\&. An example for that are bridge or bond master profiles, that get autoconnected but without activating any slaves\&. Such master devices hang in activating state indefinitely, and cause
|
|
Packit |
5756e2 |
NetworkManager\-wait\-online\&.service
|
|
Packit |
5756e2 |
to fail\&.
|
|
Packit |
5756e2 |
.RE
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fB\-t\fR | \fB\-\-timeout\fR \fIseconds\fR
|
|
Packit |
5756e2 |
.RS 4
|
|
Packit |
5756e2 |
Time to wait for a connection, in seconds\&. If the option is not provided, the environment variable
|
|
Packit |
5756e2 |
NM_ONLINE_TIMEOUT
|
|
Packit |
5756e2 |
is honored\&. The default timeout is 30 seconds\&.
|
|
Packit |
5756e2 |
.RE
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fB\-x\fR | \fB\-\-exit\fR
|
|
Packit |
5756e2 |
.RS 4
|
|
Packit |
5756e2 |
Exit immediately if NetworkManager is not running or connecting\&.
|
|
Packit |
5756e2 |
.RE
|
|
Packit |
5756e2 |
.SH "EXIT STATUS"
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fBnm\-online\fR
|
|
Packit |
5756e2 |
exits with status 0 if it succeeds, a value greater than 0 is returned if an error occurs\&.
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fB0\fR
|
|
Packit |
5756e2 |
.RS 4
|
|
Packit |
5756e2 |
Success \(en already online or connection established within given timeout\&.
|
|
Packit |
5756e2 |
.RE
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fB1\fR
|
|
Packit |
5756e2 |
.RS 4
|
|
Packit |
5756e2 |
Offline or not online within given timeout\&.
|
|
Packit |
5756e2 |
.RE
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fB2\fR
|
|
Packit |
5756e2 |
.RS 4
|
|
Packit |
5756e2 |
Unknown or unspecified error\&.
|
|
Packit |
5756e2 |
.RE
|
|
Packit |
5756e2 |
.SH "SEE ALSO"
|
|
Packit |
5756e2 |
.PP
|
|
Packit |
5756e2 |
\fBnmcli\fR(1),
|
|
Packit |
5756e2 |
\fBNetworkManager\fR(8)\&.
|