|
Hi
Thanks that works well I modified the script to use pkill
instead of kill and passed in the application name because I fould it would kill
the wrapper script but not the application. I guess this is because the
application was not a "critical" one. I also added a kill to remove the popup
warning.
>
# we have been idle too long and they
> # ignored the warning - it must die! > /usr/bin/kill -9 ${KILLID} > exit 0 < # we have been idle too long and they <
#kill the warning
<
/usr/bin/kill -9 $!
< # ignored the warning - it must die! < /usr/bin/pkill -u ${USER} ${KILLID} < exit 0 The disadvantage is
that it affect users who are logged in as well as idle logins
:-(
Cheers
Anthony Worrall
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brad Lackey - US-SW Desktop Product Lead Sent: 07 September 2006 13:27 To: SunRay-Users mailing list Subject: Re: [SunRay-Users] Tinmeout idle xdmcp connections I put this line in my CAM script... /opt/SUNWwbt/idle_timeout.sh $$ &Where idle_timeout.sh looks like: # Parameter 1 is the process ID to kill when idle too long, which
# usually is the parent shell script which is setup as critical in
# Sun Ray controlled Access Mode
#
KILLID=$1
#
# xidle-time returns 1000ths of second since idle
# If you change this value remember to change the warning text
#
# IDLEMAX=60000 # 1 minute = 60,000 (testing only)
# IDLEMAX=300000 # 5 minutes = 300,000
IDLEMAX=600000 # 10 minutes = 600,000
while true; do
{
sleep 60 # Check every minute to avoid CPU load
IDLE=`xidle-time`;
if [ "$?" != "0" ]; then
# No display? Exit cleanly without killing anything
exit 0
fi
if [ "${IDLE}" -gt "${IDLEMAX}" ]; then
# we have been idle too long - give one minute warning
(/usr/dt/bin/dterror.ds "This session has been idle for 10 minutes\n\nUnless the keyboard or mouse is used in the next minute\n\nthe session will be automatically ended" "Idle Session Warning" "Remove Warning" -geometry +170+300 ) &
# wait another minute
sleep 60
# Check again
IDLE=`xidle-time`;
if [ "${IDLE}" -gt "${IDLEMAX}" ]; then
# we have been idle too long and they
# ignored the warning - it must die!
/usr/bin/kill -9 ${KILLID}
exit 0
fi
fi# Wait again as we haven't been idle long enough } done # never reachedThis script relies on a binary called xidle-time. This asks the X server for idle time. I have attached the Source and a pre-compiled Solaris SPARC binary. Hope this Helps, Brad Anthony Worrall wrote: Hi This is not directly a SunRay question but I hope someone on the list can point me in the right direction. We are setting up a system where the use can choose to connect to either a Windows Terminal server, a SUSE Linux server or use a Mozilla Kiosk web browser using the "CAM Chooser Application" form the ThinThin blog (http://blogs.sun.com/ThinkThin). If a user selects the the windows Terminal server then uttsc is used to make the connection. If the user then walks away without logining in then the session will timeout and return to the CAM Chooser Application. However if a user does the same with the linux, which uses Xnest to connect to a server running gdm under SUSE, then the next user need to know to select the "disconnect option". For the web bowser I am using mozilla with openkiosk from http://mozdevgroup.com/clients/bm/. In this case if the user selects the web browser and then walks away, then the web browser will reset after an idle time but I would rather it died and returned to the CAM application chooser Thanks in advance Anthony Worrall _______________________________________________ SunRay-Users mailing list [email protected] http://www.filibeto.org/mailman/listinfo/sunray-users --
|
_______________________________________________ SunRay-Users mailing list [email protected] http://www.filibeto.org/mailman/listinfo/sunray-users
