Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a command line way to disable suspend in ubuntu 12.04?

I can only ssh to my 12.04, is there a way to disable suspend mode via command line?

Thank you.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

This should work (adapted from here).

Create a file /etc/polkit-1/50-local.d/disable-suspend.pkla containing:

[Disable suspend]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend;
ResultAny=no
ResultInactive=no
ResultActive=no
share|improve this answer
    
This worked well for me today (2013-09-22) on Ubuntu 12.04, except the directory name was /etc/polkit-1/localauthority/50-local.d –  rpilkey Sep 22 '13 at 22:25
1  
I am having huge problem with suspend so I don't dare to test this. But does it mean that, with this script, even if I order suspend (via close lid, via button, via menu button), Ubuntu will not go into suspend? –  Anh Nov 20 '13 at 22:43
1  
@anh yes, that's the idea. –  terdon Nov 21 '13 at 12:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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