#384115 gnome-session: Logout/Shutdown/Reboot via command line

#384115#3
Date:
2006-08-21 22:35:16 UTC
From:
To:
It would be nice to have some

gnome-session-remote --logout
gnome-session-remote --shutdown
gnome-session-remote --reboot
gnome-session-remote --logout-default-action
gnome-session-remote --logout-default-action --confirm

commands, that trigger these actions.
(--logout should Logout the user, despite his default action being set
to shutdown, for example; the --logout-default-action should follow the
/apps/gnome-session/options/logout_option setting.

The --confirm option should present the user a confirmation dialog; it
makes probably sense to have a --force-confirm action, too, which
overrides the /apps/gnome-session/options/logout_prompt gconf key.

#384115#8
Date:
2006-11-10 22:30:20 UTC
From:
To:
Le mardi 22 août 2006 à 00:35 +0200, Erich Schubert a écrit :

Isn't that what gnome-session-save does? What features are you precisely
missing in gnome-session-save?

#384115#13
Date:
2006-11-11 06:57:13 UTC
From:
To:
Hi,

I don't want to save the session, I want to log out _without_ saving.
And I want to be able to specify from command line what the logout
action will be: logout/shutdown/reboot.

best regards,
Erich Schubert

#384115#22
Date:
2013-12-05 12:13:24 UTC
From:
To:
Note that it's possible to do at least some of these from the command
line:

* Reboot
  dbus-send --print-reply --system --dest=org.freedesktop.ConsoleKit \
      /org/freedesktop/ConsoleKit/Manager \
      "org.freedesktop.ConsoleKit.Manager.Restart"

* Shutdown
  dbus-send --print-reply --system --dest=org.freedesktop.ConsoleKit \
      /org/freedesktop/ConsoleKit/Manager \
      "org.freedesktop.ConsoleKit.Manager.Stop"

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

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


The automated log out case may be harder though. See CloseSession():

http://www.freedesktop.org/software/ConsoleKit/doc/ConsoleKit.html#id351162