Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

For some reason Ubuntu had not been having good support for suspend. Creating the /etc/polkit-1/localauthority/50-local.d/com.ubuntu.disable-suspend.pkla file with the below disabled suspend option in the main menu in 12.04. But, the same doesn't work after moving from 12.04 to 14.04.

[Disable suspend by default]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend
ResultActive=no

How to disable suspend in 14.04?

share|improve this question
2  
bug report about this: bugs.launchpad.net/ubuntu/+source/policykit/+bug/1300460 –  Rinzwind Apr 22 at 15:10
    
@Rinzwind: The OP has not tried in the file mentioned in the bug report, the OP has mentioned a different file. –  i08in Apr 22 at 15:12
1  
If only we were able to suppress the menu entry: bugs.launchpad.net/ubuntu/+source/indicator-session/+bug/… –  Takkat Apr 27 at 16:09
    
Unfortunately the workaround does not help. I found that hint here too: sites.google.com/site/easylinuxtipsproject/… But did not help neither... –  Tom Tölke May 12 at 9:09
add comment

2 Answers 2

You can't. This is a bug in polkit in 14.04. As a workaround, you can

chmod 000 /usr/lib/pm-utils/bin/pm-action

It would help if you vote up the above-mentioned launchpad bug.

share|improve this answer
    
Changed the permissions as mentioned and Suspend was still enabled. ---------- 1 root root 2903 Nov 6 16:26 pm-action –  Praveen Sripati Apr 25 at 7:23
    
It's still in the menu - only polkit can change that - but choosing it should have no effect now, because pm-action will fail to run. –  dmd Apr 26 at 14:53
add comment

Create a new file called /etc/polkit-1/localauthority/50-local.d/com.ubuntu.disable-suspend.pkla with the following contents:

[Disable suspend (upower)]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend
ResultActive=no
ResultInactive=no
ResultAny=no

[Disable suspend (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend
ResultActive=no
ResultInactive=no
ResultAny=no

[Disable suspend when others are logged in (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend-multiple-sessions
ResultActive=no
ResultInactive=no
ResultAny=no

and then reboot.

This tells PolicyKit to automatically say "no" whenever anything asks if it's OK/possible to suspend. Logout menus will react to this by automatically removing the 'Suspend' menu choice.

I don't quite understand why, but the upower setting is needed for KDE but does not affect Unity. The login1 settings are needed for Unity but do not affect KDE.

share|improve this answer
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.