summaryrefslogtreecommitdiff
path: root/src/portable/org.freedesktop.portable1.conf
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 /src/portable/org.freedesktop.portable1.conf
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 'src/portable/org.freedesktop.portable1.conf')
-rw-r--r--src/portable/org.freedesktop.portable1.conf8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/portable/org.freedesktop.portable1.conf b/src/portable/org.freedesktop.portable1.conf
index 1343e1d544..5a09f5c2d9 100644
--- a/src/portable/org.freedesktop.portable1.conf
+++ b/src/portable/org.freedesktop.portable1.conf
@@ -63,6 +63,10 @@
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Manager"
+ send_member="ReattachImage"/>
+
+ <allow send_destination="org.freedesktop.portable1"
+ send_interface="org.freedesktop.portable1.Manager"
send_member="RemoveImage"/>
<allow send_destination="org.freedesktop.portable1"
@@ -101,6 +105,10 @@
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image"
+ send_member="Reattach"/>
+
+ <allow send_destination="org.freedesktop.portable1"
+ send_interface="org.freedesktop.portable1.Image"
send_member="Remove"/>
<allow send_destination="org.freedesktop.portable1"