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:
committed by
Yu Watanabe
parent
1166f4472d
commit
13aec9fddf
@@ -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'
|
||||
)
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user