1

I DON'T want my bebian into the hibernation status forever,how to disable hibernation on debian7?There is no /etc/default/acpi-support file on debian7.

enter image description here

An other error occur when to connect to vps_ip with ssh root@vps_ip to sudoedit the file .

sudoedit /etc/pm/sleep.d/000no-hibernate
sudoedit: unable to write to /etc/pm/sleep.d/000no-hibernate: No such file or directory
sudoedit: contents of edit session left in /var/tmp/000no-hibernate.XXaG8kTt

1

If you hibernate via pm-utils, you can create /etc/pm/sleep.d/000no-hibernate with the following content (as root):

#!/bin/sh
if [ "$1" = "hibernate" ]; then
    echo "I disabled hibernation for whatever reason"
    exit 1
fi

Don't forget to make it executable with chmod +x. You can read more about this hook mechanism in the pm-utils documentation (/usr/share/doc/pm-utils/README).

  • AN error occur when to input ':wq' ,why can't save the file /etc/pm/sleep.d/000no-hibernate ? – it_is_a_literature Jun 21 '15 at 1:11
  • @it_is_a_literature, you have to do all this (the file creation and the chmod) with superuser privileges (ie. as root). For example, use sudoedit instead of plain vim (it will run vim if that's your highest ranking editor alternative) and$ sudo chmod +x /etc/pm/sleep.d/000no-hibernate – Ferenc Wágner Jun 21 '15 at 5:54
  • An other error occur when to connect to vps_ip with ssh root@vps_ip to sudoedit the file . – it_is_a_literature Jun 21 '15 at 9:47
  • sudoedit /etc/pm/sleep.d/000no-hibernate sudoedit: unable to write to /etc/pm/sleep.d/000no-hibernate: No such file or directory – it_is_a_literature Jun 21 '15 at 9:47
  • sudoedit: contents of edit session left in /var/tmp/000no-hibernate.XXaG8kTt – it_is_a_literature Jun 21 '15 at 9:48
0

I don't know if it works but I found this on https://wiki.debian.org/Suspend for Debian 8 (Jessi):

Use this: sudo systemctl mask hibernate.target hybrid-sleep.target

0

Disable suspend and hibernation For systems which should never attempt any type of suspension, these targets can be disabled at the systemd level with the following:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

To re-enable hibernate and suspend use the following command:

sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

If you just want to prevent suspending when the lid is closed you can set the following options in /etc/systemd/logind.conf:

[Login]
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore

Then run systemctl restart systemd-logind.service or reboot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.