Here is the Citrix script that I use under CAM mode. It has a loop which
keeps the Citrix login prompt on the screen. This loop will timeout in
30 minutes.

If a user is logged in for under 30 minutes the SRSS session will not
reset after logout, but if they are logged in for over 30 minutes, on
logout, the script will fall out the bottom and the SRSS session will
reset.

Brad
---------------------------------------

#!/bin/sh

# Debug. If set to "yes" script output will be sent
to /tmp/CAMlog.$DISPLAY.$$
DEBUG=no
if [ "$DEBUG" = "yes" ]; then
        exec 2>/tmp/CAMlog.$DISPLAY.$$ 1>&2
        set -x
fi
VER="4.1"

# Citrix Application to connect to
CITRIX_APPLICATION="Desktop"
# Where the ICA Client lives unless already passed to us
ICAROOT=${ICAROOT:=/usr/lib}

# Set loop timeout minutes,
MIN_RESET_MIN=30
# Convert it to seconds
MIN_RESET_SEC=`expr $MIN_RESET_MIN \* 60`
# Capture start time in seconds
START_TIME=`perl -e 'print time(), "\n";'`

# Sleep for dtsession to start
sleep 2

# Lookup display number using either $BBDISPLAY or $DISPLAY
# so script can be run outside of CAM
DISP_NUM=`echo ${BBDISPLAY:=$DISPLAY} | nawk -F: '{split($2,disp,".");
print disp[1];}'`

# Fix Alt-Tab
xmodmap -e "clear mod1"
# Fix Printscreen, alt+printscreen
xmodmap -e 'keycode 77 = 0xff61'
# set numlock on
/usr/openwin/bin/xset led 1 

# Start loop to maintain display of Windows
XPID=`ps -ef | egrep "bin/(Xsun|Xorg) :$DISP_NUM " | nawk '{print $2}'`

while [ $XPID ] ; do

        if /opt/SUNWut/bin/utaction -e -i -c true -d false; then
                # Start Citrix client
                $ICAROOT/ICAClient/wfica -nosplash -quiet -desc 
$CITRIX_APPLICATION
        fi
        
        # Check elapsed time, if too long, break
        CURRENT_TIME=`perl -e 'print time(), "\n";'`
        ELAPSED_TIME=`expr $CURRENT_TIME - $START_TIME`
        if [ $ELAPSED_TIME -gt $MIN_RESET_SEC ]; then
                break
        fi

        sleep 2
        XPID=`ps -ef | egrep "bin/(Xsun|Xorg) :$DISP_NUM " | nawk '{print $2}'`
done 

On Mon, 2006-11-27 at 12:19 -0500, Mihai Nastase wrote:
> Hi Craig,
> 
>  
> 
> Thanks for your answer. 
> 
> I’m not sure if setting CAM application to critical will do it. Citrix
> is called from within CAM application indeed, but when a user logs off
> Citrix, CAM will not necessarly terminate. It has a loop to check if
> wfica is started and if not to start it. In our case we would need to
> restart SunRay session at this point while CAM is still running. 
> 
>  
> 
> Thanks,
> 
> Mihai
> 
>  
> 
> 
> 
> _______________________________________________
> 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

Reply via email to