Re: Patch to enable reboot/shutdown from within the session

Alkis Georgopoulos <[email protected]> Sun, 06 Dec 2009 22:02:11 +0200
Newsgroups gmane.linux.terminal-server.devel
Message-ID <[email protected]>
Στις 05-12-2009, ημέρα Σαβ, και ώρα 14:54 -0500, ο/η Stéphane Graber
έγραψε:
> I guess we can put it in /usr/share/ltsp/screen-session.d, that way 
> it'll be called before X is actually started.


This works flawlessly for me. To sum up:

1) /usr/share/ltsp/screen-session.d/XS00-halt-reboot:
# See if a reboot/halt was requested from inside the last session

case "$(cat /var/run/ldm-logout-action)" in
        REBOOT)
            exec reboot -fp
            ;;
        HALT)
            exec poweroff -fp
            ;;
esac

2) /usr/share/ldm/rc.d/X99-zzz-logout-action
# Check if the user requested a shutdown or a reboot

xprop -root -notype LDM_LOGOUT_ACTION | sed -ne 's/^LDM_LOGOUT_ACTION = "\(.*\)"/\1/p' > /var/run/ldm-logout-action || true
xprop -root -remove LDM_LOGOUT_ACTION

This can now be ran at any time upon logout, it doesn't have to be at
X99 (it can even be in a new, separate file, I just put it in
X99-zzz-logout-action because it's doing similar things).


Thanks,
Alkis


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_____________________________________________________________________
Ltsp-developer mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-developer
For additional LTSP help,   try #ltsp channel on irc.freenode.net