FS#37028 - [systemd] 207 hibernation does not work
Attached to Project:
Arch Linux
Opened by Edvinas Klovas (w0rm) - Monday, 23 September 2013, 07:42 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 19 February 2014, 13:42 GMT
Opened by Edvinas Klovas (w0rm) - Monday, 23 September 2013, 07:42 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 19 February 2014, 13:42 GMT
|
Details
Description: systemd hibernation does not work with systemd
207-5. When booting the system after it hibernated, it
always gives a fresh boot. It works fine on systemd
204-3.
Additional info: * systemd 207-5 Steps to reproduce: |
This task depends upon
Closed by Dave Reisner (falconindy)
Wednesday, 19 February 2014, 13:42 GMT
Reason for closing: Deferred
Additional comments about closing: No one seems to understand the actual bug here. Still isn't a systemd bug, either.
Wednesday, 19 February 2014, 13:42 GMT
Reason for closing: Deferred
Additional comments about closing: No one seems to understand the actual bug here. Still isn't a systemd bug, either.
There's a lot of things that might go wrong here, but systemd isn't one of them.
HOOKS="systemd autodetect modconf block filesystems keyboard fsck resume"
I also tried this
HOOKS="base systemd autodetect modconf block filesystems keyboard fsck resume"
Result doesn't change
If it any help, result of:
cat /sys/power/disk
[platform] shutdown reboot suspend
works: HOOKS="base udev autodetect ... resume filesystems"
does not work: HOOKS="base systemd autodetect ... resume filesystems"
2) the justification for closing does not address the circumstances of the bug - "resume" fails with or without the "base" hook - resume fails with the systemd hook, but not with the udev hook.
3) the claim that systemd itself is not the cause of the bug seems to suggest that the problem is with "mkinitcpio", and you are the mkinitcpio maintainer.
The "fix" does not need to be in mkinitcpio either. The fact that we setup the resume device in early userspace is a historical artifact.
Patches welcome. I do not use this feature, nor do I have any personal interest in fixing it.
One solution to a "systemd initramfs" is to simply use dracut, which works.
$ sudo yaourt -S dracut
$ sudo vim /etc/dracut.conf
$ sudo dracut -f /boot/initramfs-linux.img
But then, after some random update, about a month ago, I get boot-pauses, and then sometimes, after the "Welcome to Arch Linux!" log message, boot-hangs, when systemd is suppose to start, unless the "debug" boot parameter is added to the kernel command line. This is with either mkinitcpio or with dracut. Ha! Like some "quantum physics" event, the problem cannot be seen when it being observed! Some people have had some luck with disabling the journal, by "sudo mv /var/log/journal /var/log/journal.org". The systemd pauses and hangs may or may not be a distinct problem from the mkinitcpio systemd hook hibernation problem.
Of course, if the swap partition is not accessible for some reason with early systemd, when the hibernate file is being searched-for, then resume is going to fail with the "can't load" error message. Maybe there's a sequencing issue, accessing the swap partition.
mkinitcpio has 2 different /init binaries: one provided by the "base" hook (a shell script) and the other provided by the "systemd" hook (systemd itself). These DO NOT cooperate with each other -- the last of these two in the HOOKS variable of /etc/mkinitcpio.conf will win. Based on which binary you're using, your experience will vary. This is why packages like lvm2 now provide an "lvm2" hook as well as an "sd-lvm2" hook.
If you use the "base" hook with the "resume" hook, the resume= kernel commandline parameter will be read and the appropriate sysfs file written to to setup the resume device. If you use the "systemd" hook, then the script provided by the "resume" hook will never be run. Ever. This is the basis for the misunderstanding in this bug report.
Therefore: If you want the resume hook to work with the systemd hook, you need to go write code. You have a few options:
1) Write a generalized solution for running the shell based hooks under systemd.
2) Write an sd-resume hook which replicates the functionality of the resume hook.
3) Write some other method of writing the resume device major:minor to /sys/power/resume which doesn't take place in early userspace. I'd bet that, for a lot of systems, you might even be able to get away with using tmpfiles.d for this.
Git formatted patches against mkinitcpio can be sent to arch-projects@archlinux.org if you'd like to take on options 1 or 2.
https://bugs.freedesktop.org/show_bug.cgi?id=75176