summaryrefslogtreecommitdiffstats
path: root/src/shutdown/shutdown.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-05-29 17:40:28 +0200
committerLennart Poettering <lennart@poettering.net>2024-05-29 17:42:02 +0200
commit79645d7376a5173c1a09172aaf2fa30e6c0958dd (patch)
tree437eddcbe5c785b1ba41710ed8d08562c5c76aed /src/shutdown/shutdown.c
parentwatchdog: reset last ping timestamp when opening watchdog (diff)
downloadsystemd-79645d7376a5173c1a09172aaf2fa30e6c0958dd.tar.xz
systemd-79645d7376a5173c1a09172aaf2fa30e6c0958dd.zip
shutdown: explicitly close watchdog with disarm=false before we destroy watchdog resources
Otherwise we'll close the device disarming it as side-effect of watchdog_free_device(), which is not intended. Hence, let's close the fd first explicitly leaving it armed. Fixes: #33075
Diffstat (limited to '')
-rw-r--r--src/shutdown/shutdown.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c
index 67f44e16e9..d998bc5473 100644
--- a/src/shutdown/shutdown.c
+++ b/src/shutdown/shutdown.c
@@ -561,7 +561,10 @@ int main(int argc, char *argv[]) {
}
/* We're done with the watchdog. Note that the watchdog is explicitly not stopped here. It remains
- * active to guard against any issues during the rest of the shutdown sequence. */
+ * active to guard against any issues during the rest of the shutdown sequence. Note that we
+ * explicitly close the device with disarm=false here, before releasing the rest of the watchdog
+ * data. */
+ watchdog_close(/* disarm= */ false);
watchdog_free_device();
arguments[0] = NULL; /* Filled in by execute_directories(), when needed */