From 0854ac48efa7d273d36a66c5ac86fef2053f122f Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 16 Apr 2026 22:32:22 +0100 Subject: [PATCH] docs: document LUO support --- docs/FILE_DESCRIPTOR_STORE.md | 25 +++++++++++++++++++++++++ man/sd_notify.xml | 11 +++++++++++ man/systemd.service.xml | 9 +++++++++ 3 files changed, 45 insertions(+) diff --git a/docs/FILE_DESCRIPTOR_STORE.md b/docs/FILE_DESCRIPTOR_STORE.md index 8fa2ae0127..e6141a4e01 100644 --- a/docs/FILE_DESCRIPTOR_STORE.md +++ b/docs/FILE_DESCRIPTOR_STORE.md @@ -181,6 +181,31 @@ continuously). For further details see [Resource Pass-Through](https://www.freedesktop.org/software/systemd/man/latest/systemd-soft-reboot.service.html#Resource%20Pass-Through). +## Kernel Live Update (kexec) + +On kernels that support the [Live Update +Orchestrator](https://docs.kernel.org/userspace-api/liveupdate.html) +(LUO), the fdstore may also be preserved across a `kexec`-based reboot into a +new kernel. This allows updating the kernel itself without losing pinned +resources such as serialized service state, analogous to soft reboot, but for +the kernel. + +Only file descriptors that reference LUO-compatible kernel objects can be +preserved this way. Currently the kernel supports `memfd` only for LUO, but +more types are being worked on. Other kinds of file descriptors (sockets, +regular files, etc.) will be dropped from the store during the kexec transition. + +LUO preservation of the fdstore is triggered automatically whenever a +kexec-based reboot is initiated on an LUO-capable kernel, and is gated by a +similar rule as soft-reboot: the service must have +`FileDescriptorStorePreserve=yes` set, so that its fdstore remains loaded. On +the other side of the kexec, the system manager rebuilds the mapping of fds +back to their original service units, so that when those services are +re-activated the fds are passed to them using the normal fdstore protocol. +Adding a `FDNAME=…` string identifying the fd is also highly recommended, +otherwise in case multiple fds are stored, it will be impossible to +distinguish them, as they will all carry the default name (`stored`). + ## Initrd Transitions The fdstore may also be used to pass file descriptors for resources from the diff --git a/man/sd_notify.xml b/man/sd_notify.xml index f9bb56b2d4..52685c404b 100644 --- a/man/sd_notify.xml +++ b/man/sd_notify.xml @@ -428,6 +428,17 @@ For further information on the file descriptor store see the File Descriptor Store overview. + On kernels that support the Live Update Orchestrator, + compatible file descriptors stored this way (such as memfd_create2) + are additionally preserved across kexec-based reboots and handed back to the + service on the other side, provided FileDescriptorStorePreserve=yes is set on + the service (see + systemd.service5). + See the File Descriptor Store + overview for details. + diff --git a/man/systemd.service.xml b/man/systemd.service.xml index b25f1a90aa..028c1144b0 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -1266,6 +1266,15 @@ RestartMaxDelaySec=160s See the File Descriptor Store overview for details. + Setting this to yes also ensures the file descriptor store is kept loaded + across a kexec-based reboot on kernels supporting the Live Update Orchestrator, + so that compatible file descriptors (such as memfd_create2) + are preserved and handed back to the service on the other side. See the File Descriptor Store overview for + details. + Use systemctl clean --what=fdstore … to release the file descriptor store explicitly.