hibernating from plasma works with elogind 238.3 works. But when i try to hibernate with elogind 239.3 i get: elogind-daemon[3500]: Failed to write hibernation disk offset: Invalid argument elogind-daemon[3500]: Error during inhibitor-delayed operation (already returned success to client): Invalid argument btw. "echo disk > /sys/power/state" also works
Works fine for me fwiw.
i currently use lvm inside a luks container and the swap partition is also a lvm partitio inside the luks container
the problem is lvm in the src/sleep/sleep.c /* if it's a swap partition, we just write the disk to /sys/power/resume */ if (streq(type, "partition")) return write_string_file("/sys/power/resume", device, 0); the code tries to write the lvm swap name to /sys/power/resume in my case device holds /dev/mapper/lm-swap trying to the same in a shell outputs # echo /dev/mapper/lm-swap > /sys/power/resume bash: echo: write error: Invalid argument the correct way would be to get the major and minor id of the device and write this into the file, the bash command would be printf '%u:%u\n' $(busybox stat -L -c '0x%t 0x%T' "/dev/mapper/lm-swap") which doesn't through the error.
Created attachment 563544 [details, diff] this patch fixes the bug
Created attachment 563760 [details, diff] codestyle++ codestyle++
Created attachment 563762 [details, diff] fix typo
Created attachment 564618 [details, diff] use snprintf
I have just finished migrating toward systemd-240 (over 1000 commits!) and will have time to test this patch tomorrow. If it does not have any impact on "normal" operation, I do not see any reason for not to include it in both 239.4 and 240.1.
I have adapted the patch a bit and pushed it to the elogind v239-stable branch. It does not effect my setup, hibernation still works. Can you please try it out whether it fixes the issue for you? You can install the live version of the v239-stable branch using my life ebuild for sys-auth/elogind-239.9999 from my overlay "seden", available via layman. Thanks in advance!
but why do you try to write the device first and if a failure happens the major:minor value? this code is used the convert the value https://github.com/torvalds/linux/blob/master/init/do_mounts.c#L221 and the code natively handles https://github.com/torvalds/linux/blob/master/init/do_mounts.c#L253 major minor, so there is no need to write both values
Because it works for everybody who does need hibernation and does not have swap in LVM. Which is the vast majority of people. I know it is completely okay to write major:minor to that file. But can you guarantee for all setups that stat() will always be fast (and successful) for every single setup out there? And thus justifying to add another system call for the vast majority of setups which simply do not need it? Yes, it should be harmless. stat() doesn't even need any privileges on the file/device that is checked. But still it is more code for everyone, solving an issue for a tiny fraction.
(and I deliberately ignored the additional snprintf() here...)
i still think it's not necessary to write both values but i tested it and i can confirm it works
(In reply to Herbert Wantesh from comment #13) > i still think it's not necessary to write both values but i tested it and i > can confirm it works Thank you very much! Basically I concur. I will do some more research, you said 238 worked without issues, and will adapt if necessary. For now this change will do, but nothing is carved in stone. ;-) @Andreas: Fixed in https://github.com/elogind/elogind/commit/29fc24ebd6513f9aa14b8292e73f5217f91a99b1
thanks Sven, this will be in 239.4?
< Basically I concur. I will do some more research I thought about it, /sys/power/resume will only take devices from /dev and every device in /dev has a major:minor id so there is no reason to paste the /dev name and if it doesn't work paste the major:minor.
Arches, please stabilise.
amd64 stable
Stabilisation superseded by bug 682158.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29a3948ef6f55a500b4549a276fe5ca7c28f1173 commit 29a3948ef6f55a500b4549a276fe5ca7c28f1173 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2019-04-01 21:36:41 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2019-04-01 21:45:09 +0000 sys-auth/elogind: Drop 239.3 Closes: https://bugs.gentoo.org/677062 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> sys-auth/elogind/Manifest | 1 - sys-auth/elogind/elogind-239.3.ebuild | 129 ---------------------------------- 2 files changed, 130 deletions(-)