[K12OSN] lts.conf query - next step for setprinters.sh

Jim McQuillan jam at mcquil.com
Wed Mar 23 14:39:24 UTC 2005


Henry,

There's a couple of problems with server-side programs trying to access
the lts.conf file.

1)  If the entries in lts.conf are setup by MAC address, you won't
    be able to get a match, because you don't know the MAC address of
    the workstation.  Sure you can search the arp cache for a match,
    but that gets really clumsy.

2)  With the power of X, we can run apps on multiple servers.  There's
    no guarantee that you are running your app on the same machine that
    contains the lts.conf file.

This is really the same issue that we ran into with sound.  We needed to
know which sound daemon was configured for a each workstation.  We
started out trying to parse the lts.conf file on the server.  But, for
the reasons mentioned above, it didn't work very well.

That's when we figured:  "Let's ask the terminal".  And we developed
ltspinfod as a daemon that runs on the client.  And we developed
ltspinfo, which is a perl script that runs on the server, and will talk
to the daemon.  Run:   ltspinfo -h ws001 -c SOUND_DAEMON
and it will go out and ask terminal ws001 which sound daemon is
configured.

That's the kind of thing we could do for choosing a default printer.
The problem right now is that only *some* of the variables in lts.conf
are actually setup to be returned from ltspinfod.  What we really need
to do is modify the rc.sysinit script to export ALL of the settings from
lts.conf, so that we can query any arbitrary settings and get the
values.  That way, you could just add any parameters you want to
lts.conf, and then ask each workstation for the value of your new
parameter.

Seems like a reasonable thing to do, so i'll add it to my list of
requests for the next time I update rc.sysinit.

Thanks,
Jim McQuillan
jam at Ltsp.org





On Wed, 23 Mar 2005, Henry Burroughs wrote:

> Jim,
>
> A little while back I wrote a script that changes the default printer
> for a user based on which client/terminal they are logged on (I have a
> spread out K12LTSP implementation).  Right now admins have to edit a
> file called /etc/sysconfig/ltsp_printers to associate terminals and
> print ques (an extra step).  Would it be possible for me to modify my
> script so that it instead checks the lts.conf file for the
> information...(You inspired me with the grouping) like so:
>
> [lslabQUE]
>     DEFAULT_PRINTER = lslab-hp
>
> [knslabQUE]
>     DEFAULT_PRINTER = knslab-hp
>
> #actual machine
> [lslabn01] LIKE = lslabQUE
> [lslabn02] LIKE = lslabQUE
> #etc
>
> My next question is can I add my own options (ie: DEFAULT_PRINTER) to
> lts.conf?  If I can hack this together, it would make it easier for
> people.  I would use getltscfg in my profile.d script.  Could we get
> something like this included in the base LTSP or K12LTSP?
>
> Also, is there documentation under the wiki yet for this type of
> configuration for the lts.conf (as well as possible options, etc)?
>
> Thanks!
>
> Henry Burroughs
> Technology Director
> Hilton Head Preparatory School
> www.hhprep.org
>
> >
> > ______________________________________________________________________
> > From: Jim McQuillan <jam at mcquil.com>
> > To: caldodge at fpcc.net, Support list for opensource software in schools. <k12osn at redhat.com>
> > Subject: Re: [K12OSN] lts.conf query
> > Date: Tue, 22 Mar 2005 15:10:19 -0500
> >
> >
> >
> > On Tue, 22 Mar 2005, Calvin Dodge wrote:
> >
> > > Huck wrote:
> > > > Is it possible to say in lts.conf
> > > >
> > > > [ws120 - ws129]
> > > >    XSERVER = sis
> > > >
> > > >
> > > > [ws130 - ws139]
> > > >    XSERVER = ati
> > > >
> > > >
> > > >
> > > > ??
> > > >
> > > > or do I have to explicitly set each one?
> > > >
> > > > or maybe something like
> > > >
> > > > sislab = ws120,ws121,ws122,ws123,ws124,ws125,ws126,ws127,ws128,ws129
> > > >
> > > > and then
> > > >
> > > > [sislab]
> > > >    XSERVER = sis
> > >
> > > I'm having a little trouble determining this from the source code (100K of
> > > Perl), but I doubt either of the above options is possible.
> >
> > Makes me wonder what source code you are looking at.  I wrote getltscfg
> > in C.
> > And, btw,  [ws120 - ws129] is unfortunately NOT valid.
> >
> > What you could do, is setup something like this:
> >
> >
> > [DellGX1]
> >    XSERVER = sis
> >
> > [HPVectra]
> >    XSERVER = ati
> >
> > [ws120] LIKE = DellGX1
> > [ws121] LIKE = DellGX1
> > [ws122] LIKE = DellGX1
> > [ws123] LIKE = DellGX1
> > [ws130] LIKE = HPVectra
> > [ws131] LIKE = HPVectra
> > [ws131] LIKE = HPVectra
> >
> >
> > Hope that helps,
> >
> > Jim McQuillan
> > jam at Ltsp.org
> >
> >
> >
> >
> > >
> > > The following script will add the appropriate entries to lts.conf
> > > (n=120;while [ $n -le 129 ];do echo \[ws$n\];n=$((n+1));echo "   XSERVER = sis
> > > ";done) >>/opt/ltsp/i386/etc/lts.conf
> > >
> > > Calvin
> > >
> > > --
> > > Calvin Dodge
> > > Certified Linux Bigot (tm)
> > > http://www.caldodge.fpcc.net
> > >
> > >
> >
>




More information about the K12OSN mailing list