Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand that clicking "shut down" from the menu that comes up on clicking the cogwheel triggers the following command to be executed:

dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown

However, when I execute this command on a terminal, I get the following error:

Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files

Is it because 14.04 uses some other service for shutting down, or am I doing something wrong?


Note: This question is in follow-up of:

share|improve this question
1  
This is essentially a duplicate of askubuntu.com/questions/1792/… The answer here should be moved to the other question as it is well-formatted and correct... – Cas May 17 at 22:57
up vote 21 down vote accepted

systemd-logind manages user sessions in 14.04 (replacing consolekit and upower with login1), the commands to use are now:

PowerOff:

dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.PowerOff" boolean:true

Reboot:

dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:true

Suspend:

dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Suspend" boolean:true

Hibernate:

dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Hibernate" boolean:true

Source: forum.ubuntu-fr.org

share|improve this answer
    
Works exactly as intended, but would be great if you could mention the source of the solution. – i08in Apr 24 '14 at 5:34
    
I've updated my answer with a source – Sylvain Pineau Apr 24 '14 at 7:04

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.