some questions

Gavin McCullagh gmccullagh at gmail.com
Thu Aug 2 01:21:43 BST 2007


Hi,

On Tue, 31 Jul 2007, Kai Wüstermann wrote:

> Am Dienstag, den 31.07.2007, 14:41 +0100 schrieb Gavin McCullagh:
> 
> > On Mon, 30 Jul 2007, Vince Callaway wrote:
> > 
> > > I had a similar issue.  My solution was to assign fixed addresses to each
> > > workstation in my dhcpd configuration.  In the /etc/profile I check for
> > > hostname and set default printer using "lpoptions -d PrinterName".  Calling
> > > lpoptions as a regular using defines the default in  ~/.cups/lpoptions
> > 
> > Unless I've misunderstood, I think this will work for workstations but
> > probably not for thin clients -- which all have the same hostname.
 
> That would not matter. I think I will give each client a static
> ip-address and a hostname via DHCP. It is easier to remember where the
> client is placed.

The question is, how will your script know what thin client the user is
actually on (in order to figure out what printer to use)?  If you run
ifconfig or check the hostname, you'll see the ip address or hostname of
the server not the client so I suspect you need to use something like the
ESPEAKER env var to determine what thin client the user is sitting at.

> > A nice variation on this for thin clients might be to create a
> > DEFAULT_PRINTER option in lts.conf.  This would get passed through to LDM
> > which could run lpoptions as part of its ssh login.  Then you don't bother
> > with static ips, just associate mac address and printer directly in
> > lts.conf.
> 
> This sounds nice! But i can't find a DEFAULT_PRINTER option in lts.conf
> and don't know how to configure this for LDM. I would need much help.

I'm suggesting this as a new variable.  This functionality doesn't exist
just now.  I'm just back (this past hour) from holidays so I haven't had
time to look at it in detail yet.  My idea is basically:

 - define a new DEFAULT_PRINTER option in lts.conf which must be
   a printer name 
 - possibly also define a DEFAULT_PRINT_SERVER of the form server[:port]
 - modify the ldm python script to check if these options are set set and
   if so, run lpoptions as mentioned in the thread
 - profit.

I think this should add no more than 5-10 lines to ldm.  I would hope it
shouldn't be madly difficult in ldm2 either, but I've yet to look at the
recent ldm2 code.  It seems like being able to set the default printer per
host is an important feature, so I think it's worth trying this out.  I'd
welcome advice from more experience LTSP developers on whether this would
be of interest to them or if there's a better approach they'd prefer.

> > This should be fairly straightforward to hack together in feisty (you can
> > probably just modify the python code in /opt/ltsp/i386/usr/sbin/ldm), but
> > it might also be a nice and hopefully fairly simple-to-implement feature to
> > get added to LDM2.
> 
> No, I don't think, that I am able to modify python code;-)

I might be able to give it a bash.

Gavin




More information about the edubuntu-users mailing list