Score:1

Weird hibernation behavior with systemctl hibernate

cn flag

I've followed this tutorial to enable hibernation on my ubuntu device: Anthony O.'s answer to Hibernate and resume from a swap file

When I hibernate using sudo s2disk, everything works fine and there is no problem, however, even though I have edited systemctl hibernate to execute the same command, sudo s2disk, with some tasks before and after it as told in the answer, it performs some weird behaviors. First, the screen goes black for a couple of seconds, then it comes back to normal state where the machine is fully functional except it has no internet, and after a couple of seconds like nothing has happened, it suddenly goes black again and after a few times monitor turning off because of no video output and turning on again at black screen output, s2disk log comes up which shows the savestate progress, as normal. Then, sometimes, randomly, yes, it doesn't always happen for some reason, the CPU/GPU/PSU (can't figure out which) goes to full speed making a jet engine sound for a couple of seconds and goes back to normal speed for another couple of seconds until the computer shuts down, the entire process taking about 30 seconds, about 5 seconds of which being the actual savestate where it shows me the log and percentage. After booting the machine back on, it loads the image as normal according to boot messages, but then, sometimes, randomly, the login screen comes up and asks me for the password, although I set it not to do so using the command gsettings set org.gnome.desktop.screensaver ubuntu-lock-on-suspend false. And with using sudo s2disk instead of systemctl always logs in automatically and works fine. Here is some debugging info:
Memory size: 8GB, about 7.2GB usable
Swapfile size and location: 16.0GB, located at root partition as a file with an offset of 34816 and partition UUID of c3fbcd96-c1fb-4e4c-bba3-82882bf3915f.
Disk type: SSD, ext4 partition on /dev/sdb3 mounted as /
Grub config line: GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=c3fbcd96-c1fb-4e4c-bba3-82882bf3915f resume_offset=34816"
systemd hibernate service override settings:

[Service]
ExecStart=
ExecStartPre=-/bin/run-parts -v -a pre /lib/systemd/system-sleep
ExecStart=/usr/sbin/s2disk
ExecStartPost=-/bin/run-parts -v --reverse -a post /lib/systemd/system-sleep

/etc/initramfs-tools/conf.d/resume: resume=UUID=c3fbcd96-c1fb-4e4c-bba3-82882bf3915f resume_offset=34816
Ubuntu version: Ubuntu 20.04.2.0 LTS running on UEFI firmware mode and GPT partition scheme.
Is this a bug/compatibility issue or I have done something wrong?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.