Printing from SunRays in Kiosk mode

Chris Hoogendyk choogend at
Thu Oct 25 15:37:13 EDT 2001

BACKGROUND: I'm running SunRays in Kiosk mode. I can use lpadmin to set
up printers and lpr to print to them through NT server's print queues so
that they can make use of the library's LAN printers and the pay for
print services.

I can also write scripts to get at the SunRay administrative database
and access information based on the MAC address of the specific SunRay
to determine it's location and station name (assuming no one moves them
around without telling me). Then I could use this to route printing to
the nearest or otherwise appropriate printer for that SunRay.

I have been debugging by creating a world writeable log file in my own
directory, writing debug lines in my scripting that echos to the end of
that file, and then doing a session recycle on my SunRay while doing a
tail -f on the log file from my desktop -- so, for example, I can do a
"/usr/ucb/printenv >> logfile" and see what the environment is at a
particular stage in the scripting.

NOTE: Kiosk mode generates tmp home directories on the fly with user
nobody for each SunRay, so all SunRays are running as the user nobody,
although each one has it's own home directory. Recycling the session on
a SunRay trashes the home directory, and a new one is built on the fly
by the Kiosk software scripts.


QUESTION: I need to know where the best/proper place is to put code
(shell script) that will set environment variables such as PRINTER (for
ucb lpr) and USERNAME (for my own tracking). I need to have access to
either $CORONA_TOKEN (containing, e.g., "pseudo.080020c0e0f0", where
"080020c0e0f0" is the MAC address),  or $HOME (after it has been set to
"/tmp/nobody.pseudo.080020c0e0f0"), so that I can catch the MAC address
to use in identifying the SunRay.

The problem I am running into is that if I put code into /etc/profile,
$HOME appears to be "/" when it is executed, and $CORONA_TOKEN is not available.

If I put code into /etc/opt/SUNWut/kiosk.start, then I have access to
$CORONA_TOKEN, but the environment variables I set don't seem to be
present once the user is up and running (they were when I did it in
/etc/profile). I used, in either case, e.g.,

   export PRINTER

I'm confident now that I can handle the scripting, the question is
tracking the startup of the SunRay in Kiosk mode and knowing what
scripts are running when, what environment variables are available when,
and where I should put my code. Just as a simple snafu example, I
originally set my code up as a script that I could call from anywhere
and then discovered that the environment variables that I was setting
didn't propogate back out of the script (they are accessable from
scripts it calls, not from the scripts that called it).


A side question that would only be answerable if someone had firsthand,
in depth experience with Kiosk mode: 

If I went into /etc/opt/SUNWut/kiosk.start, and mucked with the USER
variable, changing it from nobody to one from a specific group of
accounts I set up for that purpose, would Kiosk mode break? Or would it,
nevertheless, go about it's business and end up creating on the fly home
directories like, e.g., /tmp/ws102.pseudo.080020c0e0f0, where the ws102
came from the USER that I had set in the code? 

If I created those users in the group nobody, and nothing on the server
was owned by them except their /tmp home directories, is there any
difference in security? Will they be treated in permissive ways that the
user nobody would not be?


Thank you,


Chris Hoogendyk

   O__  ---- Network Specialist & Unix Systems Administrator
  c/ /'_ --- Library Information Systems & Technology Services
 (*) \(*) -- W.E.B. Du Bois Library
~~~~~~~~~~ - University of Massachusetts, Amherst

<choogend at>


More information about the sunmanagers mailing list