System freezes during suspend after 2024-06-13 qemu update

Incremental updates and testing the result brought me to the conclusion that the systemd update from 255 → 256 was responsible for the suspend failures, after all. In retrospect, the systemctl Journal started to show “Failed to freeze unit ‘user.slice’” errors after the failed update on June 19.

Github has two issues that highlight this bug.

33626 might well be the root cause of this failure; the proposed patch has not yet appeared in any kernel.

33083 explains what happened [1]

Yeah, that’s expected. Because we started freezing user sessions in v256. Yet I think the real problem lies in the kernel.

and proposes a possible fix [2].

# systemd_dir=/etc/systemd/system/systemd-suspend.service.d
# mkdir -p $systemd_dir
# touch $systemd_dir/disable_freeze_user_session.conf
# cat << EOF > $systemd_dir/disable_freeze_user_session.conf
[Service]
Environment="SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false"
EOF

Not tested yet, I just put systemd updates on hold.

[1] https://github.com/systemd/systemd/issues/33083#issuecomment-2188836347
[2] https://github.com/systemd/systemd/issues/33083#issuecomment-2196565757