FS#60650 - [systemd] testing/systemd fails to hibernate

Attached to Project: Arch Linux
Opened by Chet Gurevitch (chetgurevitch) - Tuesday, 30 October 2018, 20:38 GMT
Last edited by Christian Hesse (eworm) - Thursday, 15 November 2018, 10:24 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Dave Reisner (falconindy)
Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 22
Private No

Details

Description:
Attempting to hibernate with systemd 239.300-1 results in this output

Failed to hibernate system via logind: Resume not configured, can't hibernate

Seems like there's a lot of churn going on in this area, the latest commit in upstream fails one step earlier:

Failed to hibernate system via logind: Kernel image has been removed, can't hibernate

Everything works fine in 239.6 (1e6d6c7), will try to look into this more later.
This task depends upon

Closed by  Christian Hesse (eworm)
Thursday, 15 November 2018, 10:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  systemd 239.300-2
Comment by Dave Reisner (falconindy) - Tuesday, 30 October 2018, 21:23 GMT
> Failed to hibernate system via logind: Kernel image has been removed, can't hibernate

Maybe you shouldn't try to hibernate just after upgrading the linux package... Can you confirm that it still fails after rebooting on the new kernel and with 239.300-1?
Comment by loqs (loqs) - Tuesday, 30 October 2018, 21:27 GMT
The issue in systemd-stable looks to be 6789dca0a26df0c44ff8020f0a4206bf21e52a7a
The issue in system none stable is edda44605f06a41fb86b7ab8128dcf99161d2344
Comment by Chet Gurevitch (chetgurevitch) - Tuesday, 30 October 2018, 23:31 GMT
Both errors occur on cold boot, systemd is trying to find the kernel itself in an arch unfriendly way. I tracked that issue back to the same commit as loqs before making the bug report and patching it to look in the right place which resulted in the system attempting to hibernate and crashing logind, so there’s more going on.

Comment by loqs (loqs) - Wednesday, 31 October 2018, 17:03 GMT
@chetgurevitch can you boot the systemd package from testing with the boot option systemd.log_level=debug to see the exact failure path being taken in https://github.com/systemd/systemd-stable/commit/6789dca0a26df0c44ff8020f0a4206bf21e52a7a
Comment by nl6720 (nl6720) - Thursday, 01 November 2018, 11:40 GMT
This is what I get:

systemd-logind[407]: Enough swap for hibernation, Active(anon)=168752 kB, size=4194300 kB, used=0 kB, threshold=98%
systemd-logind[407]: Failed to open "/efi/loader/loader.conf": No such file or directory
systemd-logind[407]: Failed to read boot config from "/efi/loader/loader.conf": No such file or directory
systemd-logind[407]: Failed to load bootspec config from "/efi/loader": No such file or directory
systemd-logind[407]: Cannot read boot configuration from ESP, assuming hibernation is not possible.

ESP is mounted to /efi, that's why it's trying use that path; but I don't use systemd-boot so /efi/loader/loader.conf obviously doesn't exist.
Comment by loqs (loqs) - Thursday, 01 November 2018, 14:36 GMT
@nl6720 can you report this upstream https://github.com/systemd/systemd/issues ? The commit in systemd is 5fdf2d51c244288ac41443d1bd81365fab7b7b81.
Comment by nl6720 (nl6720) - Thursday, 01 November 2018, 15:38 GMT Comment by Martin Pinsker (Martin.Pinsker) - Friday, 09 November 2018, 20:20 GMT
Workaround is to create a fake systemd-boot configuration:
This at least works for me (Intel system with grub):

[/boot/loader/loader.conf]:
default arch
timeout 4
console-mode max
editor no

[/boot/loader/entries/arch.conf]:
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=<as in cat /proc/cmdline> quiet resume=<as in cat /proc/cmdline>
Comment by Bernie Innocenti (codewiz) - Sunday, 11 November 2018, 07:53 GMT Comment by Olaf Herfurth (Olaf.Herfurth) - Sunday, 11 November 2018, 13:59 GMT
The workaround from Martin.Pinsker (fake system-boot configuration) works on EFI-Systems, if you create these two files in /boot/efi/loader:

[/boot/efi/loader/loader.conf]:
default arch
timeout 4
console-mode max
editor no

[/boot/efi/loader/entries/arch.conf]:
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=<as in cat /proc/cmdline> quiet resume=<as in cat /proc/cmdline>
Comment by Caleb Reister (calebreister) - Wednesday, 14 November 2018, 02:31 GMT
That workaround didn't work on my EFI system. However, I'm using Btrfs in an OPAL2.0-encrypted SSD.
Comment by martynas mikalajunas (martynas) - Wednesday, 14 November 2018, 12:06 GMT
Hi,

I would recommend to increase severity of this bug- I've updated 3 laptops with this version of systemd and in all of them hibernation stopped working- so you close your laptop, put it in your bag and get an portable electrical heater extra...

Maybe for maintainer would be possible just to add previous version with slight version increase (like 239.300-2) so until bug is fixed arch linux would be usable for laptop users too.

The workaround for me was to install previous version, then hibernation is working as it was before. Since I'm quite a new with linux, it took me some time to find how to do this, hope exact command would help someone else too:

sudo pacman -U https://archive.archlinux.org/repos/2018/11/06/core/os/x86_64/systemd-239.2-1-x86_64.pkg.tar.xz
Comment by Christian Hesse (eworm) - Wednesday, 14 November 2018, 12:51 GMT
Anybody wants to try systemd 239.300-2, which reverts sleep related changes from stable repository?
Comment by Caleb Reister (calebreister) - Wednesday, 14 November 2018, 22:51 GMT
Agreed on the severity increase. This can definitely damage a laptop.
Comment by Ivan Koryabkin (apathism) - Wednesday, 14 November 2018, 23:10 GMT
I'm on systemd 239.300-2 from testing, and hibernation works like a charm for me.
I'm booting with EFISTUB, if that matters.
Comment by Christian Hesse (eworm) - Thursday, 15 November 2018, 07:33 GMT
Anybody is complaining, just one person can test? Come on!
Comment by martynas mikalajunas (martynas) - Thursday, 15 November 2018, 07:42 GMT
Hi,

I would gladly test, if you could provide some instructions how.
Comment by Ivan Koryabkin (apathism) - Thursday, 15 November 2018, 07:53 GMT
1. Do full upgrade from stable (pacman -Syu)
2. Temporarily uncomment [testing] section in your /etc/pacman.conf file
3. pacman -Sy systemd libsystemd systemd-sysvcompat
4. Comment [testing] section back
Comment by nl6720 (nl6720) - Thursday, 15 November 2018, 08:35 GMT
With systemd 239.300-2, hibernation works for me.
Comment by martynas mikalajunas (martynas) - Thursday, 15 November 2018, 08:37 GMT
Thanks for instructions. Works on my laptop :)
Comment by Domenico Panella (archdom) - Thursday, 15 November 2018, 08:45 GMT
i've installed systemd,libsystemd and systemd-sysvcompat from testing repository (239.300-2) , works for me.
I've booting with Grub, if that matters.
Thanks!
Comment by Chet Gurevitch (chetgurevitch) - Thursday, 15 November 2018, 09:48 GMT
239.300-2 working fine for me as well
Comment by Christian Hesse (eworm) - Thursday, 15 November 2018, 10:23 GMT
Thanks for testing!

Loading...