From: Yu Watanabe Date: Sat, 16 Aug 2025 16:00:37 +0000 (+0900) Subject: core/service: do not reset watchdong when unit is frozen X-Git-Tag: v257.9~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb49c86fc00447d24a9b8ba7a09e6de8a4350cd6;p=thirdparty%2Fsystemd.git core/service: do not reset watchdong when unit is frozen Even watchdog for a service is stopped when freezing the unit is requested, sd-notify message WATCHDOG=1 or friends may come after that due to ordering of event priority. In that case, service_reset_watchdog() is called for frozen unit and thus previously watchdog was reenabled. Follow-up for 25178aadb2bd04ef9e63f48c1ef42fb309f9332e. Fixes #38551 (the second failure case). (cherry picked from commit 0cf84c9a60eb833252c77ab96ef2d4f094f39dc1) --- diff --git a/src/core/service.c b/src/core/service.c index 25ccff1975f..0f7f76869c2 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -408,6 +408,12 @@ static void service_extend_timeout(Service *s, usec_t extend_timeout_usec) { static void service_reset_watchdog(Service *s) { assert(s); + if (freezer_state_finish(UNIT(s)->freezer_state) != FREEZER_RUNNING) { + log_unit_debug(UNIT(s), "Service is currently %s, skipping resetting watchdog.", + freezer_state_to_string(UNIT(s)->freezer_state)); + return; + } + dual_timestamp_now(&s->watchdog_timestamp); service_start_watchdog(s); }