systemctl: add new option to mount image inside a running service namespace

Use the new DBUS method and follow the same pattern as the
systemctl bind command.
This commit is contained in:
Luca Boccassi
2021-01-21 19:08:40 +00:00
parent af47713952
commit 6faecbd353
7 changed files with 126 additions and 2 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ _systemctl () {
list-timers list-units list-unit-files poweroff
reboot rescue show-environment suspend get-default
is-system-running preset-all'
[FILE]='link switch-root bind'
[FILE]='link switch-root bind mount-image'
[TARGETS]='set-default'
[MACHINES]='list-machines'
[LOG_LEVEL]='log-level'
+5
View File
@@ -32,6 +32,7 @@
"list-dependencies:Show unit dependency tree"
"clean:Remove configuration, state, cache, logs or runtime data of units"
"bind:Bind mount a path from the host into a unit's namespace"
"mount-image:Mount an image from the host into a unit's namespace"
)
local -a machine_commands=(
@@ -383,6 +384,10 @@ done
_files
}
(( $+functions[_systemctl_mount-image] )) || _systemctl_mount-image() {
_files
}
# no systemctl completion for:
# [STANDALONE]='daemon-reexec daemon-reload default
# emergency exit halt kexec list-jobs list-units