summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-02-01 14:29:40 +0000
committerLuca Boccassi <luca.boccassi@microsoft.com>2021-02-10 19:07:36 +0000
commite26fe5f91158a0d9133e61347650dfb73aadd6bb (patch)
tree1c64821ec0b4ade12c447e1f7ea6f98664d7b592 /man
parent9e4079d4111894db0cbd6c51e9f8252c9fd22330 (diff)
downloadsystemd-e26fe5f91158a0d9133e61347650dfb73aadd6bb.tar.gz
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.
Diffstat (limited to 'man')
-rw-r--r--man/portablectl.xml17
1 files changed, 16 insertions, 1 deletions
diff --git a/man/portablectl.xml b/man/portablectl.xml
index 3653207d72..bd0c9e0573 100644
--- a/man/portablectl.xml
+++ b/man/portablectl.xml
@@ -156,6 +156,20 @@
</varlistentry>
<varlistentry>
+ <term><command>reattach</command> <replaceable>IMAGE</replaceable> [<replaceable>PREFIX…</replaceable>]</term>
+
+ <listitem><para>Detaches an existing portable service image from the host, and immediately attaches it again.
+ This is useful in case the image was replaced. Running units are not stopped during the process. Partial matching,
+ to allow for different versions in the image name, is allowed: only the part before the first <literal>_</literal>
+ character has to match. If the new image doesn't exist, the existing one will not be detached. The parameters
+ follow the same syntax as the <command>attach</command> command.</para></listitem>
+
+ <para>If <option>--now</option> and/or <option>--enable</option> are passed, the portable service(s) are
+ immediately stopped if removed, started and/or enabled if added, or restarted if updated. Prefixes are also
+ accepted, in the same way as described in the <command>attach</command> case.</para>
+ </varlistentry>
+
+ <varlistentry>
<term><command>inspect</command> <replaceable>IMAGE</replaceable> [<replaceable>PREFIX…</replaceable>]</term>
<listitem><para>Extracts various metadata from a portable service image and presents it to the
@@ -328,7 +342,8 @@
<varlistentry>
<term><option>--now</option></term>
- <listitem><para>Immediately start/stop the portable service after attaching/before detaching.</para></listitem>
+ <listitem><para>Immediately start/stop/restart the portable service after attaching/before
+ detaching/after upgrading.</para></listitem>
</varlistentry>
<varlistentry>