CUPS printer filtering on LTSP fat clients

Nick Fenger nick.fenger at gmail.com
Tue May 20 07:09:29 UTC 2014


I was unable to get printer filtering working using the LDM_PRINTER_LIST or
PRINTER_LIST environmental variables so I've solved this for my fat clients
(and full-install machines) by running multiple instances of the cups
service on different ports and pointing my client cups client.conf to those
servers via my own CUPS_CLASS_SERVER variable in lts.conf

On the server create: /etc/cups-classroom-printers/cupsd.conf:
Port 11631
ServerRoot /etc/cups-classroom-printers/class101
CacheDir /var/cache/cups-room101
RequestRoot /var/spool/cups-room101
TempDir /var/spool/cups-room101/tmp


In my fat client image:
cat /opt/ltsp/i386-fat/usr/local/bin/cups-class-server.sh
#!/bin/bash
serveraddress=$(getltscfg CUPS_CLASS_SERVER)
echo "ServerName $serveraddress" > /etc/cups/client.conf

lts.conf:
  DEFAULT_DISPLAY_MANAGER=/usr/bin/lightdm
  KEEP_SYSTEM_SERVICES=lightdm
  RCFILE_01=/usr/local/bin/cups-class-server.sh

[Room101]
 CUPS_CLASS_SERVER=10.0.0.1:11631
[ltsp001]
 LIKE = Room101
[ltsp002]
 LIKE = Room101

Changes in printers for the group of clients are made via
http://10.0.0.1:11631 and propagate to the clients without requiring a
reboot as using LDM_PRINTER_LIST did.







On Wed, May 14, 2014 at 2:21 PM, Nick Fenger <nick.fenger at gmail.com> wrote:

> This could be workaround for the LDM_PRINTER_DEFAULT
>
> lpoptions -d Default-Printer-Name-You-Want
>
> This script could be modified to run the command.
> https://github.com/gdi2k/mac2xrandr
>
> ---------- Forwarded message ----------
> From: Michael Blinn <mblinn at peopleplaces.org>
> Date: Fri, Dec 7, 2007 at 5:47 AM
> Subject: Re: [Ltsp-discuss] Set printer dwfault & permission
> To: ltsp-discuss at lists.sourceforge.net
>
>
> Abu.Zahra:
>
>   I use the following script, originally written by Peter Scheie, to set
> the default printer. Unfortunately, evince doesn't respect it [UPDATE: it
> does now] - most everything else does. I'm not sure how to allow an
> unprivileged user restart a queue, sorry.
>
> Cheers,
>  Michael
>
>
> #!/bin/sh
> # Set default printer based on which workstation is being used
> # Propers to Peter Scheie (peter at scheie.homedns.org)
> ws=$(echo $LTSP_CLIENT|cut -d. -f1)
> case $ws in
>    ws0-007 ) lpoptions -d CupsPrinterName ;;
>    ws0-017 ) lpoptions -d Shared_Color_Printer ;;
>    ws1-007 ) lpoptions -d OtherCupsPrinter ;;
>    # and so on for the library workstations
>
>    # now assign printers for the lab workstations
>    # ws013 ) lpoptions -d lab_printer ;;
>    # ws014 ) lpoptions -d lab_printer ;;
>    # and so on
> esac
>
> ### End of script
>
>
> On Wed, May 14, 2014 at 1:32 PM, Nick Fenger <nick.fenger at gmail.com>wrote:
>
>> Veli-Matti et al,
>>
>> Have you/anyone figured out how to read the LDM_PRINTER_LIST setting from
>> lts.conf with fat clients?
>>
>> In a thin client setup, I notice PRINTER_LIST is passed when XSession is
>> started, which is not the case with fat clients.
>>
>> ltsp005   1000  0.0  0.0  12312   272 ?        Ss   May13   0:00 bash -c
>> XDG_DATA_DIRS=/tmp/ltsp-localapps-ltsp005-BFCbvt/:/usr/local/share/:/usr/share/
>> LTSP_CLIENT=10.0.40.103 LTSP_CLIENT_HOSTNAME=ltsp005
>> *PRINTER_LIST=LEP-Room-205,The-Printer-In-This-Room*LIBGL_ALWAYS_INDIRECT=true LC_ALL=en_US.UTF-8 LANGUAGE=en_US.UTF-8
>> LANG=en_US.UTF-8 DISPLAY=10.0.40.103:7  PULSE_SERVER=tcp:10.0.40.103:4713ESPEAKER=
>> 10.0.40.103:16001 LTSP_ALSA_DEFAULT=pulse */etc/X11/Xsession* "default"
>> < /dev/null > /dev/null ; /usr/sbin/ltspfsmounter all cleanup
>>
>>
>>
>>
>> On Thu, May 5, 2011 at 6:48 AM, Veli-Matti Lintu <
>> veli-matti.lintu at opinsys.fi> wrote:
>>
>>> Hello everyone,
>>>
>>> I'd have a quick question about the CUPS printer filtering patch that is
>>> in the Ubuntu CUPS version (the patch can be found at least here:
>>> http://patches.ubuntu.com/by-release/extracted/ubuntu/c/cups/1.4.1-5ubuntu2/printer-filtering.dpatch
>>> )
>>>
>>> If I understand correctly, it is used on LTSP systems by adding
>>> LDM_PRINTER_LIST setting in lts.conf which is then turned to PRINTER_LIST
>>> environment variable when the user logs in. The patch above then filters
>>> not listed printers out from the user's printer list.
>>>
>>> As here we are running quite a few fat clients that have their own local
>>> USB printers, we changed from configuring fat clients to use LTSP server's
>>> cups via /etc/cups/client.conf and instead run a local CUPS server on the
>>> fat clients. The CUPS server on the LTSP server broadcasts printer
>>> information to the LTSP network and the local CUPS processes on the fat
>>> clients then pick up the printers from the broadcasts. CUPS adds local USB
>>> printers automatically and they don't need to be configured through server
>>> lts.conf. Of course they are not usable by other users in the network, but
>>> it's not a problem.
>>>
>>> This works nicely as long as we want to show all printers to the user.
>>> In bigger environments where a cluster of servers serves many schools, this
>>> doesn't work so nicely and that's where the LDM_PRINTER_LIST setting helps.
>>> The problems come when we want to show also the local USB printers that
>>> CUPS configures automatically when they are attached. As the
>>> LDM_PRINTER_LIST doesn't include the local printers, they are always
>>> filtered out from the printer list.
>>>
>>> We've been now doing some test patches to filter out only printers that
>>> are not local, but I'd be interested to know if anyone else has tried using
>>> a setup like this? The same filtering could be also applied to laptops if
>>> the PRINTER_LIST env variable is set somewhere when the user logs in.
>>>
>>> Ideas? Comments?
>>>
>>> Veli-Matti
>>>
>>> --
>>> edubuntu-users mailing list
>>> edubuntu-users at lists.ubuntu.com
>>> Modify settings or unsubscribe at:
>>> https://lists.ubuntu.com/mailman/listinfo/edubuntu-users
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/edubuntu-users/attachments/20140520/9cde39a4/attachment-0001.html>


More information about the edubuntu-users mailing list