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
+1 -1
View File
@@ -45,7 +45,7 @@ _networkctl() {
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword
local -A OPTS=(
[STANDALONE]='-a --all -h --help --version --no-pager --no-legend --no-ask-password
-s --stats -l --full --no-reload --runtime'
-s --stats -l --full --no-reload --no-reconfigure --runtime'
[ARG]='-n --lines --json --drop-in'
)
+1
View File
@@ -58,5 +58,6 @@ _arguments \
'(- *)--version[Show package version]' \
'--drop-in=[Use the given drop-in file name]:NAME' \
'--no-reload[Do not reload the network manager state when editing]' \
'--no-reconfigure[Reload config files without reconfiguring network interfaces]' \
'--json=[Shows output formatted as JSON]:format:_networkctl_get_json' \
'*::networkctl commands:_networkctl_commands'