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.

When I suspend Ubuntu I can't get out of the suspend screen. Yes, I know there are ways to fix this but that would take forever to fix. Is there a way to disable the ability to suspend?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

To a point you could control this in policykit, in /usr/share/polkit-1/actions/org.freedesktop.upower.policy and or /usr/share/polkit-1/actions/org.freedesktop.login1.policy

The relevant entries would be org.freedesktop.upower.suspend & org.freedesktop.login1.suspend respectively

In that case editing the line <allow_active>yes</allow_active> to <allow_active>no</allow_active> would work.

It's probable that in 13.10 policykit is no longer used for this so those edits would have no effect. In that case you could figure out how hibernate has been disabled & do the same for suspend or cause power management to inhibit suspend altogether.

The latter could be done as such -

sudo nano /etc/pm/sleep.d/00_cancel-suspend

copy & paste this in -

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

Then on keyboard go

ctrl+o

enter

ctrl+x

to save & exit nano

Finish with -

sudo chmod 0755  /etc/pm/sleep.d/00_cancel-suspend
share|improve this answer
    
I'm not sure if it actually worked but weirdly enough when I tried suspend it worked. Thank You!!! –  rajlego Mar 2 at 1:27
    
NM it works just fine thanks!! –  rajlego Mar 2 at 13:15

That should be easy!

Open System Settings (Top right button) --> Power options --> Set lid options to Nothing.

share|improve this answer
    
I've already domes that, but under the available options when I press the power button on my MBP it shows lock suspend restart and shut down. I want it to be physically impossible to make it go into suspend mode –  rajlego Mar 1 at 22:54

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.