I need to disable everything related to having the netbook-server go into sleep/hibernate/shutdown. Spinning down the disks during inactivity is fine, but it is crucial that the machine remain in a state where it maintains connectivity over wi-fi (and the internet at large), as well as keep the USB subsystem up and operational (we're running a hardware modem off of it).


  • The netbook is not phyiscally accessible (it is in Thailand, I am not).
  • I have SSH access only
  • It is running vanilla Ubuntu 10.04 32 Bit
  • It is a netbook of the Asus eeePC variety

Is that possible to do via the command line without causing significant/any downtime?

  • 7
    A "server netbook"? Holy silicon! Why haven't you installed the server version of Ubuntu?
    – the-wabbit
    Oct 14, 2011 at 15:44
  • 6
    This has disaster written all over it. I have a feeling this is probably not the best solution to the underlying problem.
    – user62491
    Oct 15, 2011 at 21:57

4 Answers 4


You can disable those power management features at various level.

Graphical User Interface level

In GNOME, you should edit the following file:

sudoedit  /usr/share/polkit-1/actions/org.freedesktop.upower.policy

One section concerns the suspend function and the other the hibernate one. Each as a tag that you have to set to no:


Keyboard level

Now, to avoid the problem if the keyboard has some related keys for these features, you have to enter the following command:

gconftool -s /apps/gnome-power-manager/buttons/hibernate -t string interactive

Command line level

It would still be possible to trigger a suspend or hibernation from the command line, here is how to disable it.

We have to create an executable script in /etc/pm/sleep.d/ that will cancel any hibernate or suspend actions.

sudoedit /etc/pm/sleep.d/000cancel-hibernate-suspend

The content of this file should be:

# prevents hibernation and suspend
case "${1}" in
    exit 0

Now make that file executable:

chmod 0755 /etc/pm/sleep.d/000cancel-hibernate-suspend

On Ubuntu 16.04 LTS, I successfully used the following to disable suspend:

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

And this to re-enable it:

sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
  • After disable suspend, and close the laptop, some programs like fail2ban and systemd were to 100% cpu loads..
    – chaim
    Feb 20, 2018 at 0:17


Then there are event manager daemons apmd and acpid

They provide means to execute commands on these external events. They run the scripts they find in their config directory tree under /etc/acpi, or /etc/apm respectively.

The package acpi-support provides a set of such scripts under /etc/acpi that deal with handling special acpi buttons on laptops.

The package pm-utils provides the pm-action, pm-hibernate, pm-suspend and pm-suspend-hybrid commands. They allow to trigger hard power management events by software. The pm-tools also provide script directories to hook-in other software when switching power (saving) states.

The gnome-power-manager is a program with a graphical user interface that subscribes itself to power events and acts on them. It shows you the battery status on laptops and dims down the screen if on battery for example. It will also shutdown or hibernate the computer after some idle time or before the battery runs out, if a user is logged in.

Try just uninstalling some of those, using apt-get remove.


You can configure /etc/default/acpi-support. You can enable or disable features there. Setting SUSPEND_METHODS="none" will disable suspending by the apci-support tools.

Later, you can run:

$ sudo /etc/init.d/acpi-support restart

On the other hand, the acpid daemon will check /etc/defaults/acpi-support for knowing what it has/can do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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