[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: shutdown from gnome logout dialog



Hi,

I made 2 patches for gdm and gnome-session to trigger machine
shutdown/reboot/suspend from the gnome logout dialog. Now gnome-session

* opens a connection to GDM via the socket in /tmp/.gdm_socket
* asks GDM about which actions are available (shutdown, reboot,
  suspend). radio buttons for actions that aren't available will
  be set insensitive.
* updates the logout action variable in GDM each time you click a radio
  button
* greys out the radio button (makes it unselectable), waiting for GDM's
  acknowledge
* activates and makes the radio button clickable again upon GDM's
  response. kind of visual feedback.

This is done 100% non-blocking, so (unless my code crashes) the logout
dialog will always be responsive. GDM assigns one logout action variable
to each X session and will not honor it before your X session ends.
That is, other users can log in and out without problems between you
setting your logout action to 'reboot' and actually ending your session.

If you hit the cancel button in the gnome logout dialog then GDM will
remember your selection until you open the logout dialog again. Of
course, the radio button you selected the last time will be
pre-activated for you. If the wrong radio button is pre-activated
then some script kiddie used the gdm-talk command line tool on your
machine to set another exit action for you. She would have to have
read access to your .Xauthority file and read/write access to the
GDM socket, though.

If you hit OK and selected anything but 'logout only', gnome-session
exits and GDM will run the post-session script, kill (or reset?) the
X server and instead of starting the login prompt, will shutdown or
reboot or whatever. Without flicker :-)

I think my patches won't make it into the current debian unstable
because that functionality is gnome 2.6 stuff. Just posting it
here for the impatient, like me.

See
http://jarno.gmxhome.de/gdm-shutdown/logout.html

Best regards,
Jarno


PS: Bcc's sent to the GDM and gnome-session maintainers.




Reply to: