Nick Ross wrote:
I'd try 'utsession -p -x', you'll find all the information there in an 
easy-to-parse format.  The only drawback is that it requires root privileges to 
run.

No, it has a much bigger drawback. It also does a utauthd callback, so is expensive and impacts a critical system service, plus it does a lot more work than is required for a single token lookup since it's reporting status for all sessions. This is particularly significant in Kiosk startup scripts, since when a FOG comes online (e.g. after a network outage) a lot of DTUs may connect at once and attempt to run Kiosk startup scripts simultaneously. utauthd can become a significant bottleneck in this case if you rely on commands that do utauthd callbacks in your scripts - utauthd's primary responsibility is connecting DTUs to sessions. Generally speaking, any command that reports "connected" status for DTUs is doing utauthd callbacks. This includes utsession -p, utwho -c, utuser -c, and utdesktop -c.

utuser -p is the way to go here.

-Bob

Best Regards,
Nick Ross

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Bob Doolittle
Sent: Wednesday, March 11, 2009 10:47 AM
To: SunRay-Users mailing list
Subject: Re: [SunRay-Users] Finding out which DTU or token I'm using

utuser -p is much better than utdesktop -lc or utwho -c, both of which involve callbacks to utauthd.
utuser -p is cheaper since it's a simple SRDS lookup.

-Bob

Ceri Davies wrote:
We're running SRSS4.1 with kiosk sessions and cards, the type of kiosk
session being selected from the card token.

When a kiosk session runs, SUN_SUNRAY_TOKEN is set to something like
user.1231424265-2914.  I'd like to tie that back to the DTU that the
session is on, plus the card that is inserted.

Currently, the best I can do is to get the card token into $CARD_TOKEN
from:

  utuser -p $SUN_SUNRAY_TOKEN | tail -2 | awk '/./ {print $1}'

or:

  utwho -c | awk "/$SUN_SUNRAY_TOKEN/ {print \$5}" | sed s/P*./pseudo/

which I'm going to assume isn't all that safe, then go back through:

  utdesktop -lc | awk "/$CARD_TOKEN/ {print \$1}"

for the desktop id.

None of the other ways that I've seen (abuse of UTDEVROOT, "utuser -p
$SUN_SUNRAY_TOKEN", etc.) seem to work.

Did I miss something, or is this just the only way now?

Cheers,

Ceri
------------------------------------------------------------------------

_______________________________________________
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

_______________________________________________
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