FreeBSD and the CUPS Server Part III subject logo: UNIX
2009-09-09
Posted by: badanov

First item is to ensure FreeBSD even sees the parallel port. For that I direct the reader to this page which will allow you to do several tasks which will familiarize you with the FreeBSD printing environment. You should pay close attention to what kind of interface the printer requires.

Some printers have only a USB interface while others have both a USB and a parallel interface. The HP 932C had a parallel interface, so I only had to pipe the contents of a plain text file to the parallel port to verify the parallel port works:
cat /home/user/testfile.txt > /dev/lptr0
Which should print the contents of the file you just piped in.

Next is to install Samba 2.2 or higher and CUPS from the ports collection.

It is critical to get Samba running so that Windows PC will even search for network printers. Pay close attention to the three printer parameters in the global section of the smb.conf file:

printing = cups
printcap name = cups

You should have two printer shares, one of them named specifically for the label you will give the printer. The HP printer has a label of HP-CUPS and that is the name of the Samba share. You can call your printer whatever you want. The following are the critical elements of the printer share:

printable = yes
path = /var/spool/samba
public = yes
guest ok = yes
printer admin = printer_username,root

Make sure the path for the printer spool is correct and the permissions are full 777. Since I prefer share level access I also use the hosts allow directive to allow whatever hosts I want to the printer share:

hosts allow = 192.168.99.3 192.168.99.5

Make sure you have set all your Windows PC to the same netbios (network) name. Some sample netbios names I have seen are pretty cute. Since all my servers and PCs are named after WWII Russian generals it only make sense to name the netbios SOVIETARMY

Start up the Samba servers:

smbd -D
nmbd -D

Check your smbd and nmbd log files to make certain the servers are started without error, then check netstat:

netstat -ant | less

You should see:

tcp4 0 0 *.139 *.* LISTEN
udp4 0 0 192.168.99.2.138 *.*
udp4 0 0 192.168.99.2.137 *.*
udp4 0 0 *.138 *.*
udp4 0 0 *.137 *.*

Next install the CUPS server.

If you have something to add, Fire Away!

Number of Comments so far: 0

Click here for a list of stories in the Unix and Computer category