The SMB network protocol is used by many Microsoft Operating Systems to implement file and printer sharing. SAMBA is a UNIX package that implements the SMB protocol and provides a simple and easy way to import and export file systems and printer facilities. The web site for SAMBA is http://www.samba.org. The SAMBA code is extremely easy to install and the SWAT (Samba Web Administration Tool) makes configuration almost trivial.
The See the SAMBA doc/text/Printing.txt and related documentation for details on printing. In the samba.conf file [global] section or in the SWAT page for printing configuration you need to specify the that you want to have Samba handle printing, the print, lpq, and lprm commands to be used when a user prints a job, asks for status, or removes a job, and a temporary directory to hold print jobs when they are submitted.
[printers] path = /var/spool/lpd/samba # --- do not use the Samba default path = /tmp guest ok = no print ok = yes printing = lprng load printers = yes printcap name = /etc/printcap print command = /usr/bin/lpr -P%p -U%U@%M -r %s lpq command = /usr/bin/lpq -P%p -U%U@%M lprm command = /usr/bin/lprm -P%p -U%U@%M %j lppause command = /usr/sbin/lpc -U%U@%M hold %p %j lpresume command = /usr/sbin/lpc -U%U@%M release %p %j queuepause command = /usr/sbin/lpc -U%U@%M -P%p stop queueresume command = /usr/sbin/lpc -U%U@%M -P%p start
You must specify the print method as printing = lprng. In newer versions of Samba this will allow Samba to parse the LPRng printcap correctly.
You must put all of the printers which Samba has access to in the printcap file.
The lpr -U%U@%M option causes lpr to act as though user %U on host %M was the originator of the lpr request instead of the Samba server process. This makes jobs appear to be spooled by the user and commands appear to originate with the user. The use of this option is restricted; see the allow_user_setting configuration option for details. The option can also be used with the other LPRng commands as well.
When handling a file printing request, Samba first puts the file in the directory specified by the path literal. This directory must not /gbe the /tmp directory, but should be in a file system able to handle extremely large print files otherwise this facility could be used to compromise security and functionality on your system. For example, if your main LPRng spool queue directory is /var/spool/lpd then /var/spool/lpd/samba would be a good choice.