2

I have a not very well working gfx card (nVidia geForce Go 7400) in my old laptop which prevents the screen from switching back on after waking up from suspending. The system (Ubuntu 14.10) resumes, so I can hear sounds, use mouse, keyboard, etc, but the screen stays black without lights, so completely off. Whenever it accidentally suspends, I have to blindly navigate to the shutdown menu and power it off, losing all non-saved data.
Additionally I can only boot when it is cold, so I have to wait about 15min before I can restart, so this problem is pretty annoying.

What I want to accomplish now is that the system is not able to suspend anymore at all!
It should be a solution that works on all Linux distributions, with every DE (I use Unity and LXDE currently) and globally for all users, including no logged-in user (unity-greeter/lxde-greeter).
Of course it has to cover all possible suspension triggers like closing the lid, inactivity for long time, weak battery, clicking option in the shutdown menu, entering terminal command and whatever else exists.

Thanks for your suggestions.

3
+100

You can disable those power management features at various levels, as explained in this answer on ServerFault.

Graphical User Interface level

In GNOME (but should work with any Desktop supporting the Freedesktop initiative so with Unity and LXDE), 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 has a tag <allow_active> that you have to set to no:

<allow_active>no</allow_active>

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

As far as I recall, that works for Unity desktop also, but I don't think that works for LXDE.

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:

#!/bin/sh
# prevents hibernation and suspend
. "$PM_FUNCTIONS"
case "${1}" in
  suspend|hibernate)
    inhibit
    ;;
  resume|thaw)
    exit 0
    ;;
esac

Now make that file executable:

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

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.