networkctl,networkd: add --no-reconfigure flag to networkctl reload

Add a new --no-reconfigure flag to 'networkctl reload' that reloads
.network and .netdev files from disk without reconfiguring any network
interfaces. This may be useful to avoid reconfiguring multiple interfaces
simultaneously when multiple .network files are updated, or when an updated
.network file is applied to multiple interfaces.

On the networkd side, manager_reload() gains a reconfigure_links parameter
that gates the per-link reconfiguration loop. A new io.systemd.Network.Reload
varlink method is added that exposes this as an optional reconfigureLinks
boolean (defaults to true). Both plain 'networkctl reload' and
'--no-reconfigure' now unconditionally call this method first. If an older
networkd returns MethodNotFound, plain reload falls back to
io.systemd.service.Reload for backward compatibility; '--no-reconfigure'
fails with a clear error in that case.
This commit is contained in:
Nandakumar Raghavan
2026-07-20 14:35:04 +09:00
committed by Yu Watanabe
parent 1166f4472d
commit 13aec9fddf
15 changed files with 133 additions and 22 deletions
+19 -1
View File
@@ -543,7 +543,10 @@ s - Service VLAN, m - Two-port MAC Relay (TPMR)
</para>
<para>If a new, modified, or removed <filename>.network</filename> file is found, then all
interfaces that matched the file are reconfigured.</para>
interfaces that matched the file are reconfigured. This reconfiguration step can be skipped by
passing <option>--no-reconfigure</option>, in which case only config files are reloaded from disk
without reconfiguring any network interfaces. Use <command>networkctl reconfigure</command> afterwards
to selectively apply config changes per interface.</para>
<xi:include href="version-info.xml" xpointer="v244"/>
</listitem>
@@ -729,6 +732,21 @@ s - Service VLAN, m - Two-port MAC Relay (TPMR)
</listitem>
</varlistentry>
<varlistentry>
<term><option>--no-reconfigure</option></term>
<listitem>
<para>When used with <command>reload</command>, only reload config files from disk without
reconfiguring any network interfaces. This may be useful to avoid reconfiguring multiple
interfaces simultaneously when multiple <filename>.network</filename> files are updated,
or when an updated <filename>.network</filename> file is applied to multiple interfaces.
Use <command>networkctl reconfigure</command> afterwards to apply changes selectively
per interface.</para>
<xi:include href="version-info.xml" xpointer="v262"/>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--runtime</option></term>