Pages

Samba Print Server CUPS Print Server

Samba CUPS Print Server
Let us start by setting up a Samba print server that serves two printers which are set up with the
CUPS web interface (http://localhost:631). We make these printers available to everyone for
printing. We set up the CUPS printers without a driver (raw printing device). The lpstat tool will see
the printers like this.
[root@RHEL4b samba]# lpstat -t
scheduler is running
system default destination: HPColor
device for HPBlack: socket://192.168.1.244:9100
device for HPColor: parallel:/dev/lp0
HPBlack accepting requests since Jan 01 00:00
HPColor accepting requests since Jan 01 00:00
printer HPBlack is idle. enabled since Jan 01 00:00
printer HPColor is idle. enabled since Jan 01 00:00
The windows clients need to install the correct printer driver themselves, so the spooler just sends
the jobs to the print device (without any kind of processing or interpreting of the print jobs). Our
smb.conf looks like this.
[global]
server string = Public Anonymous Print Server
security = share
disable spoolss = No
printing = cups
[printers]
path = /var/spool/samba
read only = Yes
printable = Yes
use client driver = Yes
Let’s do a quick check with smbclient.
[root@RHEL4b samba]# smbclient -NL 127.0.0.1
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.10-1.4E.9]
Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (Public Anonymous Print Server)
ADMIN$ IPC IPC Service (Public Anonymous Print Server)
HPBlack Printer Local Raw Printer
HPColor Printer Local Raw Printer

That looks ok. Now you can add the printer to windows computers in the workgroup, just browse to
your Samba server in the add printer wizard. Or you can connect with the net use command as
shown below.
C:\shov>net use lpt1: \\rhel4b\HPColor
The command completed successfully.
C:\shov>net use
New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
OK LPT1 \\rhel4b\HPColor Microsoft Windows Network
The command completed successfully.
C:\shov>print shovel.bat
C:\shov\shovel.bat is currently being printed

After printing a test page (by rightclicking on the printer icon in windows and then clicking on the
print test page button of the properties dialog box) and issuing the print command from within
Firefox, the print queue looks like this.
[root@RHEL4b samba]# lpq -a
Rank Owner Job File(s) Total Size
active nobody 4 smbprn.00000001 Test Page 112640 bytes
1st nobody 5 smbprn.00000002 Mozilla Firefox 120832 bytes
For troubleshooting, it can be useful to stop (pause) the printer. This way the jobs stay in the queue.
[root@RHEL4b samba]# lpstat -t
scheduler is running
system default destination: HPColor
device for HPBlack: socket://192.168.1.244:9100
device for HPColor: parallel:/dev/lp0
HPBlack accepting requests since Jan 01 00:00
HPColor accepting requests since Jan 01 00:00
printer HPBlack disabled since Jan 01 00:00 -
Paused
printer HPColor is idle. enabled since Jan 01 00:00
HPBlack-4 nobody 112640 Sat 07 Jul 2007 07:59:33 AM CEST
HPBlack-5 nobody 120832 Sat 07 Jul 2007 08:00:04 AM CEST

Forex Trading