From d95a8f5a13dda838574cd1cb6196b767cf596a3f Mon Sep 17 00:00:00 2001 From: Andreas Fuchs Date: Mon, 9 Dec 2024 08:57:47 -0500 Subject: [PATCH] Document the logic around X-NotSocketActivated in the manual --- .../manual/development/unit-handling.section.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/nixos/doc/manual/development/unit-handling.section.md b/nixos/doc/manual/development/unit-handling.section.md index deb120b9fadd..709a55f934d6 100644 --- a/nixos/doc/manual/development/unit-handling.section.md +++ b/nixos/doc/manual/development/unit-handling.section.md @@ -58,11 +58,16 @@ checks: before the activation script is run. This behavior is different when the service is socket-activated, as outlined in the following steps. - - The last thing that is taken into account is whether the unit is a service - and socket-activated. If `X-StopIfChanged` is **not** set, the service - is **restart**ed with the others. If it is set, both the service and the - socket are **stop**ped and the socket is **start**ed, leaving socket - activation to start the service when it's needed. + - The last thing that is taken into account is whether the unit is a + service and socket-activated. A correspondence between a + `.service` and its `.socket` unit is detected automatically, but + services can **opt out** of that detection by setting + `X-NotSocketActivated` to `yes` in their `[Service]` + section. Otherwise, if `X-StopIfChanged` is **not** set, the + service is **restart**ed with the others. If it is set, both the + service and the socket are **stop**ped and the socket is + **start**ed, leaving socket activation to start the service when + it's needed. ## Sysinit reactivation {#sec-sysinit-reactivation}