Chapter 7. Printing

File serving is considered by most to be Samba’s bread and butter. However, pulling up a close second in justifications for deploying Samba is its capability to centrally manage printers and to make them available across a network to Windows clients. The chapter focuses on the steps necessary to add print services to Samba’s configuration as well as the details for sending print jobs from Unix and Linux clients to remote SMB/CIFS printers via smbclient.

Because Samba relies on a functioning, underlying print system, we will concentrate on sharing printers that have previously been configured on the server. If you need to refresh yourself on Unix printing details, three good references are Network Printing, by Matthew Gast and Todd Radermacher, Essential System Administration, by Æleen Frisch, and Running Linux, by Matt Welsh et al., all published by O’Reilly.

Print Shares

Samba at heart is not a printing system, but rather a spooling system. Its mantra is, “If Unix can print to it, so can I.” To implement this philosophy, it must define a mechanism—an external commands or software library—to use when performing operations such as printing spooled jobs, retrieving a list of jobs in a queue, or pausing a printer.

Figure 7-1 illustrates the process of sending a print job to a Samba printer. The client opens the spool file on the server, writes the file in its entirety, and then closes the file, indicating that the job is ready to be printed. ...

Get Using Samba, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.