On 6/23/06, ottomeister <[EMAIL PROTECTED]> wrote:
Offhand I don't know what's available in the environment
of the Xstartup script. I'm pretty sure the username is
available, I don't know whether the environment from
Xconfig (including SUN_SUNRAY_TOKEN) is available.
If I have time later today I'll experiment with it.
$SUN_SUNRAY_TOKEN is not available in the Xstartup
environment, so you'll have to use something like 'utwho'
to discover the token that matches $DISPLAY. As an
example the following quick hack works for me, but it's
only lightly tested and I make no guarantess about its
correctness or safety. Save it as /etc/dt/config/Xstartup
and give it read+execute permissions. It will record
Sun Ray session logins in /var/log/SunRayLogins.
#! /bin/ksh -p
# (This must be a ksh script if it's going to source its
# counterpart in /usr/dt, because that's a ksh script.)
if [ -r /usr/dt/config/Xstartup ] ; then
. /usr/dt/config/Xstartup
fi
# If this login is happening on a local X display then if this is
# a Sun Ray session log the time, username and token
#
LOCALDISPNUM=`echo "$DISPLAY" | /bin/sed -n -e 's/^:\([0-9]*\).*/\1/p' `
if [[ -n "$LOCALDISPNUM" ]] ; then
# This is a local X display
#
INFO=`/opt/SUNWut/bin/utwho | \
/bin/awk '$1 == LDN { print $3,$2 }' LDN="$LOCALDISPNUM" `
if [[ -n "$INFO" ]] ; then
# utwho says that this is a Sun Ray session
#
NOW=`/bin/date +%Y-%m-%d_%H:%M:%S`
print "$NOW $INFO" >> /var/log/SunRayLogins
fi
fi
exit 0
OttoM.
__
ottomeister
Disclaimer: These are my opinions. I do not speak for my employer.
_______________________________________________
SunRay-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/sunray-users