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.

After upgrading to Ubuntu 12.10, when I click on suspend/hibernate in the menu, nothing happens. When I run pm-hibernate or pm-suspend in the terminal, I was told that i need to be root to use them. Of course, sudo pm-hibernate and sudo pm-suspend can work. How do I get the hibernate/suspend buttons in my menu to work again?

share|improve this question
    
possible duplicate of How can I suspend/hibernate from command line? –  Ringtail Oct 21 '12 at 14:07
2  
Looks like ben is first interested in getting the menu item to work. –  John S Gruber Oct 22 '12 at 3:50
add comment

1 Answer

Here's a workaround. First you'll need to create a script that is on your PATH. I'd recommend putting something like this in your ~/.bashrc file if you don't have it already:

PATH=/home/<username>/bin:$PATH

Then create a script /home/<username>/bin/pm-suspend which contains:

#!/bin/sh
sudo pm-suspend

Finally edit the sudoers file to not ask for a password for the pm-suspend command:

sudo visudo

Add the following line as the last rule in the file:

<username> ALL=NOPASSWD:/usr/sbin/pm-suspend

If you now launch a new terminal window/tab you should now be able to run pm-suspend without sudo and suspend from your desktop. It's a bit or a bodge but seems to work for now.

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.