Jedy/Sherry:

> Sherry gave us the whole story. The logic you mentioned will be
> implemented in ConsoleKit which will be integrated after b128. So
> currently, we have 2 options. The first one is to wait ConsoleKit's
> integration. The second one is to integrate the current fast reboot
> support of GNOME restart dialog at b124 and then update it after
> ConsoleKit's integration after b128.

Note that ConsoleKit currently does not support the ability to respond
to different types of reboot options.  So, I assume part of the plan to
use ConsoleKit in the future is to enhance it so it can support doing
this.

>> 2. Options for GDM
>>
>>      2.1 With unmodified HAL
>>
>>      Currently GDM uses the interfaces provided by HAL.  hald runs
>>      as a privileged process and checks for required
>>      authorizations.  If the caller has sufficient authorization to,
>>      say reboot, it will invoke hal-system-power-reboot-sunos.sh.

GDM and ConsoleKit do not use HAL at all today.  GDM/ConsoleKit support
shutdown/reboot as follows today:

- The new GDM rewrite has a login GUI which checks the
   solaris.system.shutdown RBAC key directly.  If the "gdm" user has
   this authorization, then GDM will present the "Shutdown" and "Reboot"
   buttons in the dialog.  If they are pressed, a message is passed to
   ConsoleKit via D-Bus.

- ConsoleKit checks to see if the user who passed the D-Bus message has
   the solaris.system.shutdown RBAC key defined.  If so, it will call a
   script.  One script for shutdown and another script for reboot.
   The shutdown script calls "/sbin/init 5" and the reboot script calls
   "/sbin/init 6".

   Note that any user can call ConsoleKit with a message to request
   shutdown or reboot.  If it was passed in from the GDM GUI by clicking
   on the associated button, then the user would be the "gdm" user.  But
   ConsoleKit will only call the shutdown/reboot script if the calling
   user has the solaris.system.shutdown authority.

In GDM 2.20 and earlier (currently used in Nevada and OpenSolaris), it
works much the same, with the following differences:

- ConsoleKit is not used at all, GDM does all the work.
- The shutdown/reboot commands are defined to be "/sbin/init 5" and
   "/sbin/init 6" in the GDM configuration.
- The new GDM uses D-Bus messages for IPC while the old GDM uses a
   private socket which can be accessed directly or via the
   gdmflexiserver program.  See "man gdmflexiserver" to see the
   commands used to trigger reboot or shutdown.

>>      A straightforward implementation would to to add a
>>          hal-system-power-reboot-regular-sunos.sh
>>      which calls the 1.1.2 interfaces to do regular reboot, and
>>          hal-system-power-reboot-fast-sunos.sh
>>      to do fast reboot.
>>
>>      However it has been communicated to me that HAL will be EOL'ed
>>      and replaced by ConsoleKit, therefore there's no point of
>>      making changes in HAL.  Without modifying HAL, and without the
>>      additional framework in SMF, the only option we have was to set
>>      the properties directly.  It's definitely not the desirable
>>      solution, but one that we can quickly put in place for the
>>      meantime.
>>
>>      2.2 With ConsoleKit
>>
>>      We should modify ConsoleKit to implement option 1.1.2.
>>
>>      I have looked at the ConsoleKit briefly, and this was what I
>>      suggested.  (Brian didn't think I understood ConsoleKit's
>>      constrains when I made the suggestion.) I believe implementing
>>      1.1.2 (or 1.1.3 if ConsoleKit would rather call a library
>>      interface) is the correct long term solution.

As I say above, ConsoleKit calls a script to reboot or shutdown, so it
would be easier to integrate a solution that invokes shutdown/reboot
via this script.

The main problem with GDM and ConsoleKit is that ConsoleKit only
provides a single D-Bus interface for "reboot" and does not currently
provide any way to pass in any options regarding what kind of reboot
is requested.

I am sure the existing D-Bus messages could be augmented to allow more
flexibility in specifying how the system should reboot.  Likewise, the
GDM login GUI could be augmented to allow users to specify what kind of
reboot they want to do if the "gdm" user has the
solaris.system.shutdown key defined.

That said, we should probably code this in a general way so that we
can get the code upstream.  We probably do not want to code a solution
that works specific to how reboot works on Solaris.  Instead, we should
probably augment ConsoleKit so that reboot can be easily enhanced to
support different kinds of reboot operations on any distribution.
Otherwise, we will not be able to get this sort of change upstream, and
be stuck maintaining a Solaris-specific patch ourselves.  Maintaining
our own patch would not be the end of the world, but it is obviously
easier to maintain the code if we can get our changes upstream.

So, to design this properly, there probably should be some discussion
about it first on the public ConsoleKit mailing list.  That way we can
make sure that any design considerations from other distributions are
taken into account as well.

   ConsoleKit at lists.freedesktop.org

In other words, I did not have any serious problems with your proposal.
More of a concern that we are trying to design new ConsoleKit features
without including the upstream community in the design process.

>> I am not having much success buildng gdm and consolekit in my build
>> environments therefore it's difficult for me to experiment.  I would be
>> happy to help resolve the issues if someone can help me build these
>> software components.

I did already provide you with binaries.  Also, these modules have
spec-files which can be used to build them.  I can help get you
up-to-speed with the build process if you touch base with me off-line.

Brian

Reply via email to