Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Command to shutdown and reboot dbus with elogind?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 680
Location: Barcelona, Spain

PostPosted: Wed Apr 01, 2020 9:41 am    Post subject: [SOLVED] Command to shutdown and reboot dbus with elogind? Reply with quote

The gentoo wiki states:

What would be the command to shutdown and reboot dbus when using elogind?

Thanks!
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Take care of the community answering unanswered posts.


Last edited by mimosinnet on Thu Apr 02, 2020 8:27 am; edited 1 time in total
Back to top
View user's profile Send private message
gripped1
n00b
n00b


Joined: 01 Jan 2020
Posts: 6

PostPosted: Wed Apr 01, 2020 11:27 am    Post subject: Reply with quote

I don't know the full answer but dev-qt/qdbusviewer, or similar, should help you to figure it out ?
Back to top
View user's profile Send private message
GDH-gentoo
Apprentice
Apprentice


Joined: 20 Jul 2019
Posts: 270
Location: South America

PostPosted: Wed Apr 01, 2020 2:09 pm    Post subject: Reply with quote

Code:
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.PowerOff boolean:false
Code:
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:false
However, because of interactions with polkit, I don't know if they can work as-is for any arbitrary nonprivileged user. Changing the last argument to boolean:true should make polkit interactively ask the user for authentication credentials if it needs to.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1827
Location: United Kingdom

PostPosted: Wed Apr 01, 2020 5:27 pm    Post subject: Reply with quote

mimosinnet,

Do those D-Bus ConsoleKit commands shutdown or restart the system, or just stop and start D-Bus? If they shutdown or restart the system, I just need to use the following commands as a non-root user on a Gentoo installation using elogind:

Code:
$ loginctl reboot


Code:
$ loginctl poweroff


Neither prompts me for a password. The first simply reboots the laptop; the second simply shuts down the installation and powers off the laptop.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
GDH-gentoo
Apprentice
Apprentice


Joined: 20 Jul 2019
Posts: 270
Location: South America

PostPosted: Wed Apr 01, 2020 7:18 pm    Post subject: Reply with quote

Fitzcarraldo wrote:
Do those D-Bus ConsoleKit commands shutdown or restart the system, or just stop and start D-Bus?
They shutdown and restart the system, and are the messages that e.g. a display manager would send to console-kit-daemon. The others I believe would be the equivalent dbus-send commands for elogind, that correspond to the D-Bus messages loginctl sends under the hood. I assumed that's what the OP wanted.
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 680
Location: Barcelona, Spain

PostPosted: Thu Apr 02, 2020 9:50 am    Post subject: Reply with quote

Thanks very much for the answers!

I have included them in the gentoo-wiki articles on Elogind and D-Bus.

Cheers! :D
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Take care of the community answering unanswered posts.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum