Default Printer Howto in Edubuntu

Jim Kronebusch jim at winonacotter.org
Fri Aug 17 19:56:10 BST 2007


Okay, I finally got the default printer by location thing working.  I tweaked the post
from last week about this to work for Edubuntu.

In /etc/profile add the following to the end all on one line:

lpoptions -d $(grep $(echo $SSH_CLIENT | awk '{print $1}') /etc/ltsp-printers.conf | cut
-f2)

I had to butcher up the original LTSP 4.2 command so that things worked by IP address
instead of $LTSP_CLIENT which returned the machine name.

Then create the /etc/ltsp-printers.conf file with 744 permissions owned by root.root. 
Format the file as such:

#Client IP Address     Printer Name
192.168.1.1     Printer1
192.168.1.2     Printer1
192.168.1.3     Printer1
192.168.1.4     Printer2
192.168.1.5     Printer2
192.168.1.6     Printer3

The first column is the IP address of the client and the second is the name of the
printer as it is set up in cups.

Then you need to modify your /etc/ltsp/dhcpd.conf file and assign fixed ip addresses by
mac address like so:

authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.100 192.168.1.253;
  option domain-name "winonacotter.org";
  option domain-name-servers 192.168.1.254;
  option broadcast-address 192.168.1.255;
  option routers 192.168.1.254;
  option subnet-mask 255.255.255.0;
  if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
    filename "/ltsp/i386/pxelinux.0";
  }
  else{
    filename "/ltsp/i386/nbi.img";
  }
  option root-path "/opt/ltsp/i386";

        host ws001 {
                hardware ethernet 00:1A:4D:2F:AA:EA;
                fixed-address 192.168.1.1;
                }
        host ws002 {
                hardware ethernet 00:1A:4D:2F:AA:EA;
                fixed-address 192.168.1.2;
                }
        host ws003 {
                hardware ethernet 00:1A:4D:2F:AA:EA;
                fixed-address 192.168.1.3;
                }
        host ws004 {
                hardware ethernet 00:1A:4D:2F:AA:EA;
                fixed-address 192.168.1.4;
                }
        host ws005 {
                hardware ethernet 00:1A:4D:2F:AA:EA;
                fixed-address 192.168.1.5;
                }
        host ws006 {
                hardware ethernet 00:1A:4D:2F:AA:EA;
                fixed-address 192.168.1.6;
                }
}

This of course means you have to go around and log all of your thin clients mac
addresses which can be a little time consuming.  But this works slick.

Also I noticed that openoffice saves printer settings in the documents.  So even though
your default printer changes when you log into a different location, your saved
openoffice.org files still retain the last printer they printed to.  From what I read
the current version of 2.2.x does not have a way to disable saving this information, but
it is slated to appear in the 2.3 version.

Jim Kronebusch
Cotter Tech Department
453-5188


-- 
This message has been scanned for viruses and
dangerous content by the Cotter Technology 
Department, and is believed to be clean.




More information about the edubuntu-users mailing list