fdstore, in order to implement service restarts with full service state being
passed over.
-# Basic Mechanism
+## Basic Mechanism
The fdstore is enabled per-service via the
[`FileDescriptorStoreMax=`](https://www.freedesktop.org/software/systemd/man/systemd.service.html#FileDescriptorStoreMax=)
And that's already the gist of it.
-# Seamless Service Restarts
+## Seamless Service Restarts
A system service that provides a client-facing interface that shall be able to
seamlessly restart can make use of this in a scheme like the following:
out-of-date security policies – SElinux, AppArmor, any LSM, seccomp, BPF — in
effect remain), and similar.
-# File Descriptor Store Life-cycle
+## File Descriptor Store Lifecycle
By default any file descriptor stored in the fdstore for which a `POLLHUP` or
`POLLERR` is seen is automatically closed and removed from the fdstore. This
issues `close()` on the socket. It must accompany it with an `FDSTOREREMOVE=1`
notification to the service manager, so that the fd is comprehensively closed.
-# Access Control
+## Access Control
Access to the fds in the file descriptor store is generally restricted to the
service code itself. Pushing fds into or removing fds from the fdstore is
setting `NotifyAccess=all` this may be relaxed to allow arbitrary service
child processes to do the same.
-# Soft Reboot
+## Soft Reboot
The fdstore is particularly interesting in [soft
reboot](https://www.freedesktop.org/software/systemd/man/systemd-soft-reboot.service.html)
For further details see [Resource
Pass-Through](https://www.freedesktop.org/software/systemd/man/systemd-soft-reboot.service.html#Resource%20Pass-Through).
-# initrd Transitions
+## Initrd Transitions
The fdstore may also be used to pass file descriptors for resources from the
initrd context to the main system. Restarting all processes after the
semantically very similar, hence similar rules apply, and in both cases it is
recommended to use the fdstore if pinned resources shall be passed over.
-# Debugging
+## Debugging
The
[`systemd-analyze`](https://www.freedesktop.org/software/systemd/man/systemd-analyze.html#systemd-analyze%20fdstore%20%5BUNIT...%5D)