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.
This commit is contained in:
msizanoen1
2022-12-08 00:54:53 +01:00
parent 2d18605ca8
commit efa736d383
+1 -3
View File
@@ -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)