| 1 |
<?xml version='1.0'?> |
| 2 |
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> |
| 3 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 4 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ |
| 5 |
<!ENTITY % entities SYSTEM "common.ent" > |
| 6 |
%entities; |
| 7 |
]> |
| 8 |
|
| 9 |
<!-- |
| 10 |
SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later |
| 11 |
|
| 12 |
NetworkManager-wait-online.service(8) manual page |
| 13 |
--> |
| 14 |
|
| 15 |
<refentry id="NetworkManager-wait-online.service"> |
| 16 |
<refentryinfo> |
| 17 |
<title>NetworkManager-wait-online.service</title> |
| 18 |
<author>NetworkManager developers</author> |
| 19 |
</refentryinfo> |
| 20 |
<refmeta> |
| 21 |
<refentrytitle>NetworkManager-wait-online.service</refentrytitle> |
| 22 |
<manvolnum>8</manvolnum> |
| 23 |
<refmiscinfo class="source">NetworkManager-wait-online.service</refmiscinfo> |
| 24 |
<refmiscinfo class="manual">Network management daemons</refmiscinfo> |
| 25 |
<refmiscinfo class="version">&NM_VERSION;</refmiscinfo> |
| 26 |
</refmeta> |
| 27 |
|
| 28 |
<refnamediv> |
| 29 |
<refname>NetworkManager-wait-online.service</refname> |
| 30 |
<refpurpose>Wait for the network to come online</refpurpose> |
| 31 |
</refnamediv> |
| 32 |
|
| 33 |
<refsect1> |
| 34 |
<title>Description</title> |
| 35 |
<para> |
| 36 |
The <literal>NetworkManager-wait-online</literal> service is a <literal>oneshot</literal> |
| 37 |
systemd service that delays reaching the <literal>network-online</literal> target until |
| 38 |
NetworkManager reports that the startup is completed on the D-Bus. |
| 39 |
</para> |
| 40 |
<para> |
| 41 |
When the system boots, for example, remote mounts defined in <literal>/etc/fstab</literal>, |
| 42 |
require that the network is up. For this, these systemd units contain the |
| 43 |
<literal>After=network-online.target</literal> setting to order themselves after this |
| 44 |
target. <literal>NetworkManager-wait-online</literal> ensures that the |
| 45 |
<literal>network-online</literal> target is reached only after the network is available. |
| 46 |
</para> |
| 47 |
<para> |
| 48 |
Optimally, all services on the host react dynamically to network changes and systemd |
| 49 |
services do not need to be configured to start after reaching the |
| 50 |
<literal>network-online</literal> target. In this case, |
| 51 |
<literal>NetworkManager-wait-online.service</literal> has no effect and does not delay |
| 52 |
the boot time. On the other hand, if you encounter a long boot time due to the delay |
| 53 |
of <literal>NetworkManager-wait-online</literal>, investigate the services that require |
| 54 |
network access and fix them. |
| 55 |
</para> |
| 56 |
<para> |
| 57 |
Except for the time out value in the <literal>NetworkManager-wait-online.service</literal> |
| 58 |
unit, you cannot configure this service. Instead, settings in NetworkManager and the |
| 59 |
connection profiles affect the behavior: |
| 60 |
</para> |
| 61 |
<itemizedlist> |
| 62 |
<listitem> |
| 63 |
<para> |
| 64 |
Startup is not complete as long as NetworkManager profiles are in an activating |
| 65 |
state. During boot, NetworkManager starts profiles with the |
| 66 |
<literal>connection.autoconnect=yes</literal> setting. If activation fails, |
| 67 |
NetworkManager retries the activation depending on the value of the |
| 68 |
<literal>connection.autoconnect-retries</literal> setting. |
| 69 |
</para> |
| 70 |
<para> |
| 71 |
NetworkManager reports startup complete when all profiles and devices are either |
| 72 |
activated or in a disconnect state and no further events are expected. |
| 73 |
</para> |
| 74 |
</listitem> |
| 75 |
<listitem> |
| 76 |
<para> |
| 77 |
When a device reaches the activate state depends on its configuration. For example, |
| 78 |
with a profile that has both IPv4 and IPv6 enabled, by default, NetworkManager |
| 79 |
considers the device as fully activated already when only one of the address |
| 80 |
families is ready. |
| 81 |
</para> |
| 82 |
<para> |
| 83 |
The <literal>ipv4.may-fail</literal> and <literal>ipv6.may-fail</literal> settings |
| 84 |
control this behavior. Additionally, the following settings influence when the |
| 85 |
two address families complete: <literal>ipv4.required-timeout</literal>, |
| 86 |
<literal>ipv6.required-timeout</literal>, <literal>ipv4.dhcp-timeout</literal>, |
| 87 |
and <literal>ipv6.ra-timeout</literal>. For details, see |
| 88 |
<link linkend='nm-settings-nmcli'><citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>. |
| 89 |
</para> |
| 90 |
</listitem> |
| 91 |
<listitem> |
| 92 |
<para> |
| 93 |
NetworkManager cannot set IP addresses on bridge and bond devices that have ports |
| 94 |
that do not auto-activate. Because of this configuration error, |
| 95 |
<literal>NetworkManager-wait-online</literal> blocks until the service reaches |
| 96 |
its timeout value. |
| 97 |
</para> |
| 98 |
</listitem> |
| 99 |
<listitem> |
| 100 |
<para> |
| 101 |
Dispatcher scripts for the <literal>pre-up</literal> event run at a late stage |
| 102 |
during activation of a profile. These scripts block the activation for when |
| 103 |
NetworkManager considers the profile fully activated. For details, see |
| 104 |
<link linkend='NetworkManager-dispatcher'><citerefentry><refentrytitle>NetworkManager-dispatcher</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>. |
| 105 |
</para> |
| 106 |
</listitem> |
| 107 |
<listitem> |
| 108 |
<para> |
| 109 |
The property <literal>connection.wait-activation-delay</literal> adds an additional |
| 110 |
delay during activation and delays startup complete. This setting works around |
| 111 |
certain cases where a device is known to not be ready for a certain amount of time. |
| 112 |
</para> |
| 113 |
</listitem> |
| 114 |
<listitem> |
| 115 |
<para> |
| 116 |
The property <literal>connection.wait-device-timeout</literal> in the connection |
| 117 |
profiles cause a delay until the waiting devices appear. This is useful if the |
| 118 |
driver takes a longer time to detect the networking interfaces. This setting is |
| 119 |
similar to the <literal>connection.gateway-ping-timeout</literal> property. |
| 120 |
</para> |
| 121 |
</listitem> |
| 122 |
<listitem> |
| 123 |
<para> |
| 124 |
With Wi-Fi devices, NetworkManager needs to wait for the first scan result to |
| 125 |
know which networks are available. That adds a delay. |
| 126 |
</para> |
| 127 |
</listitem> |
| 128 |
<listitem> |
| 129 |
<para> |
| 130 |
With Ethernet devices, NetworkManager waits for the carrier until the value in |
| 131 |
<literal>[device*].carrier-wait-timeout</literal> is reached. This is because some |
| 132 |
devices take a long time to detect the carrier. Consequently, booting with cable |
| 133 |
unplugged, unnecessarily delays <literal>NetworkManager-wait-online.service</literal>. |
| 134 |
</para> |
| 135 |
</listitem> |
| 136 |
</itemizedlist> |
| 137 |
</refsect1> |
| 138 |
|
| 139 |
<refsect1> |
| 140 |
<title>Bugs</title> |
| 141 |
<para> |
| 142 |
Please report any bugs in NetworkManager at the |
| 143 |
<ulink url="https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues">NetworkManager issue tracker</ulink>. |
| 144 |
</para> |
| 145 |
</refsect1> |
| 146 |
|
| 147 |
<refsect1> |
| 148 |
<title>See Also</title> |
| 149 |
<para> |
| 150 |
<ulink url="https://networkmanager.dev">NetworkManager home page</ulink>, |
| 151 |
<link linkend='NetworkManager'><citerefentry><refentrytitle>NetworkManager</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>, |
| 152 |
<link linkend='nm-online'><citerefentry><refentrytitle>nm-online</refentrytitle><manvolnum>1</manvolnum></citerefentry></link>, |
| 153 |
the <literal>network-online.target</literal> description in <link linkend='systemd.special'><citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry></link> |
| 154 |
</para> |
| 155 |
</refsect1> |
| 156 |
</refentry> |