pid1: make clear that $WATCHDOG_USEC is set for the shutdown binary, noone else
authorLennart Poettering <lennart@poettering.net>
Thu, 14 Nov 2024 22:16:19 +0000 (23:16 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 15 Nov 2024 13:34:06 +0000 (13:34 +0000)
commit4b20ae9a0e914e61d6bac095e5fc9664510ac03e
tree5809ea7af3682a499d12f1bded1e2443ac3025c4
parent1a077e05fbcbfffe548ef39f45e4f2ca1399715d
pid1: make clear that $WATCHDOG_USEC is set for the shutdown binary, noone else

We use the $WATCHDOG_USEC variable for two very closely uses: as part of
the sd_watchdog_enabled() protocol for implementing service watchdogs.
And as part of the protocol between the service manager and
systemd-shutdown across the PID 1 execve() transition during shutdown.

Apparently some exitrds tools got confused by the latter use. Let's
address that by setting $WATCHDOG_PID to 1, in accordance to the
sd_watchdog_enabled() protocol to make clear this is only intended for
PID 1 and nothing else.

Replaces: #35135
src/core/main.c