38
votes
Accepted
How can tasks "refuse to freeze" on suspend?
Task freezing is documented in detail in the kernel documentation.
User-space processes can’t refuse to freeze; they do get frozen, but the signalling between the kernel and processes is handled ...
36
votes
Ubuntu 18.04 won't wake after screen lock and blank / suspend / sleep
There seems to be an issue with nouveau driver. Edit the grub file by editing it with sudo access.
sudo vim /etc/default/grub
Add nouveau.modeset=0 to the line that says GRUB_CMDLINE_LINUX="&...
32
votes
Accepted
pm-suspend vs systemctl suspend?
In short, you should generally prefer the suspend mode integrated by your distro. For distros that ship systemd, that's typically systemctl suspend.
For instance, the Arch Linux wiki says:
systemd ...
26
votes
Make changes to `/proc/acpi/wakeup` permanent
For a USB mouse or keyboard, you can use a udev rule to make the setting permanent. First, look up the PCI vendor ID of your mouse/keyboard using lsusb. For my mouse, it's 046d:
Bus 001 Device 006:...
21
votes
Accepted
Is it safe to boot computer that lost power while suspending to disk?
If power is lost prior to explicitly entering S4 or S5 state (hereafter just referred to as "hibernation state" for simplicity), then the partially filled data in the swap partition will be ...
20
votes
Boot blocks with "Gave up waiting for suspend/resume device"
A better answer than removing it is to fix it.
If you have a dedicated swap partition, use the blkid command to find its UUID.
Then copy this (select, press Ctrl+Shift+C in the terminal window), edit ...
19
votes
how to run a user script after systemd wakeup?
This answer is based on askubuntu.com/a/661747/394818 (as also referred to in the comment by @sun-bear), askubuntu.com/q/616272/394818 and superuser.com/a/1269158/585953.
Using a system service:
...
18
votes
How to disable suspend on close laptop lid on NixOS?
While the solution proposed by Mirzhan will probably work, there is a much more elegant way using the services.logind.lidSwitch and services.logind.lidSwitchDocked options.
Now, you can just write
...
17
votes
Accepted
Boot blocks with "Gave up waiting for suspend/resume device"
Yes, there is "a special command", more specifically a Linux kernel boot option.
A lot of kernel boot options are available for various purposes.
To skip the attempt to resume from a configured ...
15
votes
How do I make my laptop sleep when it reaches some low battery threshold?
As of Debian ≥ 10 (and comparably recent Linux systems), you can just create a file /etc/cron.d/check-battery that contains:
* * * * * root [ "$(cat /sys/class/power_supply/BAT0/status)" != ...
15
votes
Accepted
Prevent system from going to sleep/suspend - how Xviewer/VLC do it
Linux applications inhibit suspend through a D-Bus call to org.gnome.SessionManager.Inhibit
Contrasting inhibit vs. prevent
Note that inhibit is different than prevent. Inhibiting a screensaver, ...
15
votes
Graceful shutdown with suspend job hanging in syscall
I know this doesn't exactly answer the question but maybe it will help somewhat.
You or someone else who will read this.
I had (or still have) similar problem now. Suspend didn't finish returning to ...
11
votes
how to run a user script after systemd wakeup?
I created a file in /lib/systemd/system-sleep/ (you can call it e.g. wakeup):
#!/bin/sh
case $1 in
post)
/bin/runme
;;
esac
Then I set the executable permission bits.
# chmod +x /usr/lib/...
10
votes
How to find reason a notebook wakes up?
For the sake of completeness, there is another solution mentioned in this answer to a similar question.
Awakened by power button:
$ sudo dmidecode | grep Wake-up
Wake-up Type: Power Switch
...
Community wiki
10
votes
Accepted
When suspending to disk, does memory cache got dumped to disk?
I’m not sure this is explicitly documented anywhere, except as a side effect. The kernel includes caches in the image written to disk (which is why you’ll find explanations of how to drop caches ...
9
votes
Accepted
How to disable suspending the system when the lid is closed?
I'm not sure Sway handles that, so first try disabling system-wide lid actions by editing /etc/systemd/logind.conf and see if it works (you can also use lock instead of ignore):
HandleLidSwitch=ignore
...
9
votes
Accepted
Disabling Suspend, etc. on Debian 12
This turns out to be a situation where the command line is apparently not the best way to go. These four steps worked:
Click the far upper right corner power button.
Click the settings gearwheel in ...
8
votes
Ubuntu 18.04 won't wake after screen lock and blank / suspend / sleep
The Screen Saver helped me with Xubuntu 18.04 - except I installed xscreensaver and everything started working correctly.
8
votes
Accepted
How does systemctl suspend work?
The defaults are "mem", "standby", "freeze" (the last two and the ability to configure sleep modes have been added in 2013 so they might not be available on older setups).
The manual page you quoted ...
8
votes
Disabling Suspend, etc. on Debian 12
I fixed it by editing /etc/gdm3/greeter.dconf-defaults, uncommenting the line, changing suspend to blank:
sleep-inactive-ac-type="blank"
and restarting gdm3:
sudo systemctl restart gdm3
...
8
votes
Accepted
Cannot fg a zsh function including less
This is a bug affecting zsh 5.9. It was fixed in November 2022 but there hasn't been a release made since as of December 2024.
If you do:
$ find . | less
^Z
zsh: suspended find . | less
$ ps -Ho pid,...
7
votes
Immediate wake-up after suspend
I don't know if you ever got this problem resolved, but I had the same thing happening on Debian buster/sid on a ThinkPad T460. The output of my dmesg wasn't identical to yours, but importantly, it ...
7
votes
Make changes to `/proc/acpi/wakeup` permanent
The preferred way to do this is by creating a service with systemd.
Adding script in rc.local is the deprecated way.
Create a script file wherever you wish. Ex: ~/scripts/disable-devices-as-wakeup.sh....
7
votes
Accepted
How do I suspend / sleep while bluetooth is active?
Cause
Kernel Bug 200039 - BT advertising packet wakes up the system from S3 and suspend-to-idle.
This affects Intel (8087:0aaa) and Atheros (0cf3:e005)(0cf3:e007) bluetooth:
Acer Swift SF314-55
Asus ...
7
votes
Accepted
"Input/output error" on wake from suspend
nvme 0000:56:00.0: Unable to change power state from D3cold to D0, device inaccessible
Oh, a nvme device with a suspend bug… fun. Not much your Linux can do without being aware of these "quirks&...
6
votes
Debian blackscreen after suspend
I struggled with a similar issue in Debian 9, installed on a Lenovo G40-30 Laptop. I went into Hibernate/Sleep
and trying to initiate again the screen didn't show up although everything seemed working....
6
votes
Accepted
How do I prevent GNOME suspending while I finish a compilation job
GNOME has developed a neat solution to this problem in the form of the gnome-session-inhibit utility. To use it you just add it before the long running command something like:
gnome-session-inhibit ...
6
votes
GNOME: disable sleep on lid close
I had solved this issue once before, but apparently recent versions of Fedora (so far from Fedora 28 to 33, inclusive), require two entries now, whereas before only one was required. So:
user$ sudo vi ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
suspend × 540power-management × 85
debian × 71
systemd × 69
linux × 68
hibernate × 55
ubuntu × 53
laptop × 37
sleep × 34
arch-linux × 31
acpi × 31
linux-mint × 30
fedora × 27
kernel × 22
nvidia × 20
linux-kernel × 17
usb × 17
xfce × 17
thinkpad × 16
gnome × 15
screen-lock × 15
wifi × 14
kde × 14
keyboard × 13
freeze × 12