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.

Subtly broken is worse than frankly broken...

Background:

  1. I already disabled suspend in System Settings -> Power.

  2. The "Suspend" option still appears on the gear menu (not that I expected it to disappear), and the sleep (moon) button on my keyboard still triggers suspend.

  3. The options in #1 are, as others have pointed out, just too easy to hit by mistake once every month or so.

  4. It seems like 1% of platforms get suspend right, because some driver engineer somewhere forgot to check that PCIe or IO space register X gets restored when upon wake. So it's worse than broken: everything usually looks fine after waking up, only it's not. And hopefully none of those corrupted registers affects reliability in a creeping manner, like ECC configuration or storage FIFO depth. But they usually do, in one form or another, which is one reason, for example, why errata against graphics drivers continue infinitely, years after they debut on the market ("graphics chip X hangs an hour after resuming from suspend blah blah blah").

  5. There should be an automated test to see what registers change across a sleep cycle, but few vendors have such a test. The test is complicated somewhat by the fact that some registers are expected to change, such as timers. And worse, sometimes you have to read registers in a certain order or with a particular granularity, or by first writing a read index somewhere else. So this process cannot be centralized at a convenient place in the industry, like Canonical's offices. It's really and truly hopeless unless PCIe is redefined in such a manner that makes comparison easy, which it won't be.

  6. The magical test suite in #5 will never be written because of the chaotic state of driver development. Hence in the absence of that, my question.

  7. I'm so desperate that I don't mind hacking on /etc/whatever_suspend_file, but it would be nice if there were a "polite" way to do this, like that nonexistent checkbox in System Settings -> Power that says "Permanently disable suspend because it was ill-conceived from day one."

  8. NB: I'm not talking about hibernation here, which shouldn't suffer from the problems above because it involves a power cycle. Although in principle, restoring registers from permanent storage could have similar problems.

share|improve this question
3  
Did you try the answer here: askubuntu.com/a/154821/72576? –  i08in May 27 at 17:57
add comment

3 Answers 3

Run the following command to open the file to edit:

sudo gedit /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

Scroll to the bottom. Check to see if the following information exists, and if not add them:

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

Doing this makes suspend do nothing when you click it; it will disappear from the menu after you restart your computer.

share|improve this answer
1  
That seems like the logical place for this, but I tried it and it doesn't work in my 14.04 environment. But I think you're on the right track, because in this file I can see similar code for disabling hibernation. –  Veiokej May 27 at 18:27
add comment

GUI

Have you looked at:

System -> Preferences -> Power Management

On AC Power Tab, Put computer to sleep when inactive for: "Never"

Terminal

Can you open up "gconf-editor"?

Look in: /apps/gnome-power-manager/timeout

Try setting sleep_computer_ac to 0

I'm not positive if anything else needs to be changed as well.

Get also a look here.

share|improve this answer
    
No such menu is visible in my 14.04 environment. I don't actually have that file, but I don't think I'd want to mess with the power management timeouts, or at the other extreme, disabling power management wholesale (unless there's actually no way to disable only suspend). –  Veiokej May 27 at 18:29
add comment

With dconf Editor, navigate to: org.gnome.settings-daemon.plugins.power

You will find lots of options relating to sleep and suspend.

share|improve this answer
    
Looks promising, but nothing to modify thus far: dconf read /org/gnome/settings-daemon/plugins/power/lid-close-battery-action 'nothing' dconf read /org/gnome/settings-daemon/plugins/power/lid-close-ac-action 'nothing' dconf read /org/gnome/settings-daemon/plugins/power/idle-dim false –  Veiokej May 29 at 12:57
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.