Found another error :-( Need full path for shutdown. I had tested from command line via ssh and though it was OK.
This script really works :-) #!/bin/bash #install xprintidle cron #add cron entry to lts.conf export DISPLAY=:7 export XAUTHORITY=`ps -ef|grep xinit |grep -v grep|cut -d" " -f 26` #`grep XAUTHORITY /var/log/ldm.log` # time is in miliseconds #90 minutes 90*60*1000 5400000 idletime=`/usr/bin/xprintidle` #/bin/date +%T >> /tmp/idletime #echo $idletime >> /tmp/idletime if (( $idletime > 5400000 )) ; then /sbin/shutdown -h now; fi ...................................... Anyone know of a better way? Maybe someone with a better understanding of ltsp knows of a better way to get the xauth set? John On Thursday 15 March 2012 04:27:49 pm (UNTRUSTED, sender <ltsp-discuss-boun...@lists.sourceforge.net> is not authenticated) wrote: > I just put together a simple system to automatically shut down terminals > after 90 minutes of inactivity. > My ltsp5 is on debian squeeze. > > install cron and xprintidle. > > I put script idleoff script in /usr/local/sbin > ............................................. > #!/bin/bash > #install xprintidle and cron packages > export DISPLAY=:7 > export XAUTHORITY=`ps -ef|grep xinit |grep -v grep|cut -d" " -f 26` > #`grep XAUTHORITY /var/log/ldm.log` > # time is in miliseconds > #90 minutes 90*60*60*1000 324000000 > idletime=`/usr/bin/xprintidle` > if (( $idletime > 324000000 )) ; then > shutdown -h now; > fi > ............................. > I'm sure it can be improved on. > No real error checking but pretty sure errors will not cause shutdown. > > in lts.conf add > CRONTAB_01 = "*/10 * * * * root /usr/local/sbin/idleoff" > > John > > > --------------------------------------------------------------------------- >--- This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _____________________________________________________________________ > Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto: > https://lists.sourceforge.net/lists/listinfo/ltsp-discuss > For additional LTSP help, try #ltsp channel on irc.freenode.net ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _____________________________________________________________________ Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto: https://lists.sourceforge.net/lists/listinfo/ltsp-discuss For additional LTSP help, try #ltsp channel on irc.freenode.net