What's the right way to shutdown Arch Linux through dbus interface?

8,589

Systemd manages dbus sessions in Arch. If you have an active logind session, then you can shutdown or reboot using systemd, without root privileges. See the power management section of the systemd page on the Arch Wiki:

systemctl poweroff

If there are other active seats, you will be prompted for a password.

Share:
8,589
daisy
Author by

daisy

Updated on September 18, 2022

Comments

  • daisy
    daisy over 1 year

    I'm running openbox with Arch Linux, and looks like the old console kit interface has been long gone,

    %> dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
    Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files
    

    So what's the interface to use now?

  • PlasmaPower
    PlasmaPower about 10 years
    Just wondering, what is the difference between this and shutdown? I have always been using the shutdown command to shutdown my system, should I be using systemd?
  • jasonwryan
    jasonwryan about 10 years
    @PlasmaPower See this question and answer: I use systemctl $command because it encourages the habit of using systemd commands.
  • PlasmaPower
    PlasmaPower about 10 years
    Thanks for the link, I was looking for a question like that. I think I will be using systemd to shutdown my system, chrome was complaining about not being shutdown properly when I used shutdown. +1, I didn't know that you had to have a logind session.
  • jasonwryan
    jasonwryan about 10 years
    @PlasmaPower Having an active login session is a very good idea: it will make a whole lot of things work as intended...