From: msizanoen1 Date: Wed, 7 Dec 2022 09:54:13 +0000 (+0700) Subject: sleep: always thaw user.slice even if freezing failed X-Git-Tag: v253-rc1~330^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efa736d3835583a0464b404ae88945d55a180d92;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 6785ae2330a..e74e334e332 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)