Commit graph

17 commits

Author SHA1 Message Date
Luca Boccassi d3322c1fdb bash completion: add missing parameters for portablectl 2024-04-18 10:47:29 +01:00
Luca Boccassi 966d7977c7 portablectl: add --clean parameter for detaching
Calls CleanUnit on each portable service being removed, after it has
stopped
2024-04-18 10:47:29 +01:00
Luca Boccassi ab16e4852e shell completion: add --copy=mixed in portablectl
Follow-up for 82047a6aa7
2024-03-16 00:11:41 +09:00
Jan Macku f8457290c4 fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
Luca Boccassi fa84c1ce00 portablectl: add --extension to bash completion 2023-04-26 08:35:20 +09:00
Dmitry V. Levin e873a9f18a treewide: fix unnecessary $ on arithmetic variables
This should fix shellcheck warning SC2004.
2023-04-01 01:48:44 +08:00
Zbigniew Jędrzejewski-Szmek 4e9183059a shell-completion/zsh: silence error when machinectl is not installed
This fixes a few unrelated issues:
- when ENABLE_MACHINED is false, machinectl is not installed, but _sd_machines
  is still used in a few places that want to complete -M and such.
  Also, bash completion calls machinectl in various places.
  Make missing machinectl mean "no machines" in this case, so
  that no error is generated in the callers.
- machinectl list --full would print multiple lines of output per machine,
  breaking grep, issue introduced in e2268fa437.
  Using --max-addresses=1 would fix the issue, but let's use
  --max-addresses=0 because we now can.
- the lists used in various places were slightly different for no good reason.
- don't use a subshell if not necessary.

The code for bash still uses the same combined list of images and running
machines for various commands. The zsh code uses images for start/clone, and
running machines for the rest. Maybe something to fix in the future.

Replaces #25048.
2022-10-20 09:58:00 +02:00
Michael Biebl 85fce6f42c Use https for gnu.org 2022-06-28 16:07:35 +02:00
Luca Boccassi 36ec026830 completion: fix 'unbound variables' errors
Fixes https://github.com/systemd/systemd/issues/19987
2021-06-22 14:56:47 +01:00
Luca Boccassi e26fe5f911 portable: add 'reattach' verb and DBUS interface
Add 'reattach' verb to portablectl, and corresponding DBUS interface
to systemd-portabled.
Takes the same parameters as 'attach', but it will do a 'detach' (and
it will refuse to proceed if it cannot be done) first, matching on
the unversioned prefix of the new image. Eg:

portablectl reattach /tmp/foo_2.raw

will cause foo_1.raw to be detached, and foo_2.raw to be attached.

The key difference with a manual 'detach old' plus 'attach new' is that
the running units are not disturbed until after the attach completed,
and if --now is passed they are then restarted.
A 'detach' is not allowed normally if the units are running.

By using a restart-after-deploy method, 'reattach' allows for minimal
interruption of service and also for features that only work on restart
(eg: file descriptor store) to work as intended.

The DBUS interface returns two lists: first the removals from the detach
that were not immediately re-added in the attach, so that the caller
can stop the relevant units, and then the list of additions that are
either new or updates, so that the caller can restart/enable the
relevant units. portablectl already implements this with the existing
--now/--enable switches.
2021-02-10 19:07:36 +00:00
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Luca Boccassi e2c1ddcc49 portablectl: add --now and --enable to attach/detach
Add shortcuts to enable and start, or disable and stop, portable
services with a single portablectl command.
Allow to pass a filter on detach, as it's necessary to call
GetImageMetadata to get the unit names associated with an image.

Fixes #10232
2020-02-07 17:09:05 +01:00
Yu Watanabe e2268fa437 bash-completion: do not ellipsize machine name 2020-01-10 12:29:02 +09:00
Zbigniew Jędrzejewski-Szmek 843cfcb15c shell-completion: use 4 space indentation too
The same as in other places, indentation levels were all over the place.
2019-04-12 08:34:44 +02:00
Zbigniew Jędrzejewski-Szmek d9b02e1697 tree-wide: drop copyright headers from frequent contributors
Fixes #9320.

for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do
  git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms'
done
2018-06-20 11:58:53 +02:00
Lennart Poettering 96b2fb93c5 tree-wide: beautify remaining copyright statements
Let's unify an beautify our remaining copyright statements, with a
unicode ©. This means our copyright statements are now always formatted
the same way. Yay.
2018-06-14 10:20:21 +02:00
Yu Watanabe 37e21077a3 bash-completion: add completion for portablectl 2018-05-28 18:15:06 +09:00