<command>systemd-networkd-wait-online</command>). When <literal>no</literal>, the network is ignored
when determining the online state. When a minimum operational state and an optional maximum operational
state are set, <literal>yes</literal> is implied, and this controls the minimum and maximum
- operational state required for the network interface to be considered online.
- Defaults to <literal>yes</literal>.</para>
+ operational state required for the network interface to be considered online.</para>
- <para>The network will be brought up normally in all cases, but in
- the event that there is no address being assigned by DHCP or the
+ <para>Defaults to <literal>yes</literal> when <varname>ActivationPolicy=</varname> is not set,
+ or set to <literal>up</literal>, <literal>always-up</literal>, or <literal>bound</literal>.
+ Defaults to <literal>no</literal> when <varname>ActivationPolicy=</varname> is set to
+ <literal>manual</literal> or <literal>down</literal>. This is forced to <literal>no</literal>
+ when <varname>ActivationPolicy=</varname> is set to <literal>always-down</literal>.</para>
+
+ <para>The network will be brought up normally (as configured by <varname>ActivationPolicy=</varname>),
+ but in the event that there is no address being assigned by DHCP or the
cable is not plugged in, the link will simply remain offline and be
skipped automatically by <command>systemd-networkd-wait-online</command>
if <literal>RequiredForOnline=no</literal>.</para>
the administrative state. When <varname>BindCarrier=</varname> is also set, this is
automatically set to <literal>bound</literal> and any other value is ignored.</para>
+ <para>When the policy is set to <literal>down</literal> or <literal>manual</literal>,
+ the default value of <varname>RequiredForOnline=</varname> is <literal>no</literal>.
+ When the policy is set to <literal>always-down</literal>, the value of
+ <varname>RequiredForOnline=</varname> forced to <literal>no</literal>.</para>
+
<para>The administrative state is not the same as the carrier state, so using
<literal>always-up</literal> does not mean the link will never lose carrier. The link
carrier depends on both the administrative state as well as the network device's physical
if (network->ignore_carrier_loss < 0)
network->ignore_carrier_loss = network->configure_without_carrier;
+ if (IN_SET(network->activation_policy, ACTIVATION_POLICY_DOWN, ACTIVATION_POLICY_ALWAYS_DOWN, ACTIVATION_POLICY_MANUAL)) {
+ if (network->required_for_online < 0 ||
+ (network->required_for_online == true && network->activation_policy == ACTIVATION_POLICY_ALWAYS_DOWN)) {
+ log_debug("%s: Setting RequiredForOnline=no because ActivationPolicy=%s.", network->filename,
+ activation_policy_to_string(network->activation_policy));
+ network->required_for_online = false;
+ } else if (network->required_for_online == true)
+ log_warning("%s: RequiredForOnline=yes and ActivationPolicy=%s, "
+ "this may cause a delay at boot.", network->filename,
+ activation_policy_to_string(network->activation_policy));
+ }
+
+ if (network->required_for_online < 0)
+ network->required_for_online = true;
+
if (network->keep_configuration < 0)
network->keep_configuration = KEEP_CONFIGURATION_NO;
.manager = manager,
.n_ref = 1,
- .required_for_online = true,
+ .required_for_online = -1,
.required_operstate_for_online = LINK_OPERSTATE_RANGE_DEFAULT,
.activation_policy = _ACTIVATION_POLICY_INVALID,
.arp = -1,
assert(network);
if (isempty(rvalue)) {
- network->required_for_online = true;
+ network->required_for_online = -1;
network->required_operstate_for_online = LINK_OPERSTATE_RANGE_DEFAULT;
return 0;
}