nm-onlinenm-online — ask NetworkManager whether the network is connected |
nm-online is a utility to find out whether we are online. It is done by asking NetworkManager about its status. When run, nm-online 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).
This tool is not very useful to call directly. It is however used by
NetworkManager-wait-online.service
with
--wait-for-startup
argument. This is used to delay
the service and indirectly network-online.target
,
until networking is up. Don't order your own systemd services after
NetworkManager-wait-online.service
directly. Instead
if necessary, order your services after network-online.target
.
Even better is to have your services react to network changes dynamically
and don't order them with respect to network-online.target
at all.
By default, connections have the ipv4.may-fail
and
ipv6.may-fail
properties set to 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
network-online.target
is reached, set the corresponding
may-fail
property to no
.
|
Print help information. |
|
Don't print anything. |
|
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 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 |
|
Time to wait for a connection, in seconds. If the option is not provided,
the environment variable |
|
Exit immediately if NetworkManager is not running or connecting. |