From 5c1e5944c09e221dd319769811e49e335ff5a072 Mon Sep 17 00:00:00 2001 From: msizanoen1 Date: Wed, 7 Dec 2022 16:54:13 +0700 Subject: [PATCH] sleep: always thaw user.slice even if freezing failed `FreezeUnit` can fail even when some units did got frozen, causing some user units to be frozen. A possible symptom is `user@.service` being frozen while still being able to log in over SSH. (cherry picked from commit efa736d3835583a0464b404ae88945d55a180d92) --- src/sleep/sleep.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 3461d3e45f..30ba5d297b 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -374,7 +374,7 @@ static int freeze_thaw_user_slice(const char **method) { } static int execute_s2h(const SleepConfig *sleep_config) { - _unused_ _cleanup_(freeze_thaw_user_slice) const char *auto_method_thaw = NULL; + _unused_ _cleanup_(freeze_thaw_user_slice) const char *auto_method_thaw = "ThawUnit"; int r, k; assert(sleep_config); @@ -382,8 +382,6 @@ static int execute_s2h(const SleepConfig *sleep_config) { r = freeze_thaw_user_slice(&(const char*) { "FreezeUnit" }); if (r < 0) log_debug_errno(r, "Failed to freeze unit user.slice, ignoring: %m"); - else - auto_method_thaw = "ThawUnit"; /* from now on we want automatic thawing */; r = check_wakeup_type(); if (r < 0)