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.

(This was previously asked, but the solution no longer works under 11.10.)

In Ubuntu 11.10 any user can suspend the machine from the power menu in the top right of the screen without needing root privileges. How can I suspend as a normal user from a command line?

share|improve this question
1  
Under 11.10 the command pmi action suspend errors out with Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files –  detly Apr 11 '12 at 10:26
    
That's a bug and should be treated as such ;) –  Rinzwind Apr 11 '12 at 10:27
    
@Rinzwind - I thought it may have been a bug of the "get it out of the repos" kind :P –  detly Apr 11 '12 at 10:30
    
I guess someone should create a .service file for org.freedesktop.Hal Noooooo idea how though :D askubuntu.com/questions/9518/… see the comment by zolti in his answer. Does that work for you? –  Rinzwind Apr 11 '12 at 10:33
    
Here's the bug –  detly Apr 11 '12 at 10:41

3 Answers 3

There is a new answer to this at How can I suspend/hibernate from command line?. You can suspend your machine (if it supports that) without any password by typing

dbus-send --system --print-reply \
    --dest="org.freedesktop.UPower" \
    /org/freedesktop/UPower \
    org.freedesktop.UPower.Suspend

This works for me on Ubuntu 12.04. Credits to Adam who posted the answer over there.

share|improve this answer
    
This only works with root for me, on Xubuntu 13.04. –  tsbertalan Mar 16 at 21:38

Test your system if it supports the pm-suspend command with the following simple script:

for m in --suspend --hibernate --suspend-hybrid 
do 
  echo -n "$m: "
  if pm-is-supported $m; then echo "supported"; else echo "not supported"; fi
done

Sample output:

--suspend: supported
--hibernate: supported
--suspend-hybrid: not supported

If you have --suspend: supported you should be able to suspend your system with sudo pm-suspend.

share|improve this answer
1  
Your answer requires sudo — please read the question again :) –  detly Apr 11 '12 at 10:17
    
You're right, although the test does not... but anyway I understand this is not what you're after. –  lgarzo Apr 11 '12 at 10:21

I'm doing this successfully with the powermanagement-interface package and "pmi action suspend" in 12.10. Perhaps the problem you were having has been corrected in updates.

share|improve this answer

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.