From e86a92f42379e5beeb1fdc37b8bfd2a727f8a13f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 4 Feb 2010 23:40:19 -0500 Subject: [PATCH 21/22] Add docs Add a section to the design docs that explains the shutdown api. --- doc/dbus/ck-design.xml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/doc/dbus/ck-design.xml b/doc/dbus/ck-design.xml index 8aca968..39da991 100644 --- a/doc/dbus/ck-design.xml +++ b/doc/dbus/ck-design.xml @@ -29,6 +29,44 @@ The Session will remain open until the Session Leader disconnects from the D-Bus + Shutdown Operation + + Generally, a user sitting at the local console should be allowed to shut + down the machine; after all, he or she can just hit the power button + anyway. However, there are circumstances under which shutting down the + machine might not be advisable: + + Multiple users might have active or inactive sessions + A system service might perform an uninterruptible operation, + such as a disk backup, a software update, etc. + + Under these circumstances, ConsoleKit will require elevated privileges + before it allows the shutdown to proceed. + + + In order to allow an orderly shutdown in the presence of multiple + sessions, the shutdown operation has to tie into the session lifecycle + as described in the org.gnome.SessionManager documentation: + + User initiates Shutdown operation + Session leader calls QueryStop() on the ConsoleKit manager object + ConsoleKit emits the QueryStop signal on all session objects + All sessions enter their QueryEnd phase + All session leaders respond back with StopResponse() + The initial QueryStop() call returns + Session leader uses GetSessions() and GetInhibitors() to assemble information to present to the user, in addition to its own inhibitors. Depending on the can_proceed value returned by QueryStop(), the dialog will offer the user to proceed with the shutdown operation + Assuming the user chooses to proceed, the session leader calls Stop() or Restart() + ConsoleKit sets the Stopping property + ConsoleKit verifies that the user has the necessary privileges + ConsoleKit emits the Stop signal on all session objects + All sessions enter their End phase + All session leaders respond back with StopResponse() + ConsoleKit shuts down the machine + + + + + Expected Usage Use of this service will usually follow one of the following patterns: @@ -92,6 +130,9 @@ The Session will remain open until the Session Leader disconnects from the D-Bus To know if the system is currently being used. + + To inhibit shutdown during uninterruptible operations. + -- 1.6.6