So I've done a little more testing. On boot, with /sys/power/resume unset (i.e. 0:0), I see this in the logind debug logs:
Jan 08 09:47:11 surprise systemd-logind[1887]: Sleep mode "disk" is supported by the kernel.
Jan 08 09:47:11 surprise systemd-logind[1887]: /dev/dm-2: is a candidate device.
Jan 08 09:47:11 surprise systemd-logind[1887]: /dev/sda2: ignoring device with lower priority
Jan 08 09:47:11 surprise systemd-logind[1887]: /sys/power/resume is not configured; attempting to hibernate with path: /dev/dm-2, device: 253:2, offset: 0, priority: -2
Jan 08 09:47:11 surprise systemd-logind[1887]: Not enough swap for hibernation, Active(anon)=1134696 kB, size=1003516 kB, used=0 kB, threshold=98%
If I set /sys/power/resume correctly, then I see:
Jan 08 09:48:10 surprise systemd-logind[1887]: Sleep mode "disk" is supported by the kernel.
Jan 08 09:48:10 surprise systemd-logind[1887]: /dev/dm-2: is a candidate device.
Jan 08 09:48:10 surprise systemd-logind[1887]: /dev/sda2: ignoring device with lower priority
Jan 08 09:48:10 surprise systemd-logind[1887]: No swap partitions or files matching resume config were found in /proc/swaps.
(I haven't been able to test what happens if I restart logind because I hit https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1910769 if I try; my plan is add an ExecStartPre which sets the resume device to logind's unit file, to see if that does the trick.)
Does anyone know what in the system is _meant_ to be setting /sys/power/resume? Is it possible I'm missing some configuration somewhere to have that setting happen?
So I've done a little more testing. On boot, with /sys/power/resume unset (i.e. 0:0), I see this in the logind debug logs:
Jan 08 09:47:11 surprise systemd- logind[ 1887]: Sleep mode "disk" is supported by the kernel. logind[ 1887]: /dev/dm-2: is a candidate device. logind[ 1887]: /dev/sda2: ignoring device with lower priority logind[ 1887]: /sys/power/resume is not configured; attempting to hibernate with path: /dev/dm-2, device: 253:2, offset: 0, priority: -2 logind[ 1887]: Not enough swap for hibernation, Active( anon)=1134696 kB, size=1003516 kB, used=0 kB, threshold=98%
Jan 08 09:47:11 surprise systemd-
Jan 08 09:47:11 surprise systemd-
Jan 08 09:47:11 surprise systemd-
Jan 08 09:47:11 surprise systemd-
If I set /sys/power/resume correctly, then I see:
Jan 08 09:48:10 surprise systemd- logind[ 1887]: Sleep mode "disk" is supported by the kernel. logind[ 1887]: /dev/dm-2: is a candidate device. logind[ 1887]: /dev/sda2: ignoring device with lower priority logind[ 1887]: No swap partitions or files matching resume config were found in /proc/swaps.
Jan 08 09:48:10 surprise systemd-
Jan 08 09:48:10 surprise systemd-
Jan 08 09:48:10 surprise systemd-
(I haven't been able to test what happens if I restart logind because I hit https:/ /bugs.launchpad .net/ubuntu/ +source/ systemd/ +bug/1910769 if I try; my plan is add an ExecStartPre which sets the resume device to logind's unit file, to see if that does the trick.)
Does anyone know what in the system is _meant_ to be setting /sys/power/resume? Is it possible I'm missing some configuration somewhere to have that setting happen?