]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
doc: clarify that root storage daemons need unit files
authorLennart Poettering <lennart@poettering.net>
Wed, 4 Jun 2025 12:50:11 +0000 (14:50 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 25 Jun 2025 17:17:42 +0000 (18:17 +0100)
Fixes: #37700
(cherry picked from commit d1bacb0b8d311413413a666d23f1025c15a74757)
(cherry picked from commit 7a0336a4a6b3c50a06e8eb29d8ef0c3ad0938318)

docs/ROOT_STORAGE_DAEMONS.md

index 86b132bc047b64e079c2aea8f20ede4aa952f4ea..5ff449a4fb6e1ceaa6e66dc31e9008fba8063619 100644 (file)
@@ -141,6 +141,34 @@ Note that your code should only modify `argv[0][0]` and leave the comm name
 Since systemd v255, alternatively the `SurviveFinalKillSignal=yes` unit option
 can be set, and provides the equivalent functionality to modifying `argv[0][0]`.
 
+## Units
+
+Any process on modern Linux systems is part of a control group ("cgroup"), and
+so will be your storage daemon's processes. On systemd systems it's systemd
+that manages the top-level cgroup tree, and the basic hierarchy of it is a
+reflection of the running units, in particular slice and service units. This
+hence means that your root storage daemon should be placed in a cgroup and
+hence in a unit, and this unit should be defined both in the initrd and during
+the rest of the runtime, so that your processes always have a valid cgroup
+mapping to a valid unit.
+
+Hence, please make sure to wrap your storage daemon in a proper service unit,
+and ensure to set:
+
+```
+[Unit]
+…
+DefaultDependencies=no
+IgnoreOnIsolate=yes
+RefuseManualStop=yes
+SurviceFinalKillSignal=yes
+…
+```
+
+These settings will ensure the unit will stay around "forever", and neither be
+stopped automatically, nor manually. And again, make sure this unit is
+available both in the initrd and on the host.
+
 ## To which technologies does this apply?
 
 These recommendations apply to those storage daemons which need to stay around