diff options
Diffstat (limited to 'docs/htmldocs/printing.html')
-rw-r--r-- | docs/htmldocs/printing.html | 3040 |
1 files changed, 1374 insertions, 1666 deletions
diff --git a/docs/htmldocs/printing.html b/docs/htmldocs/printing.html index 2b0abb56e6..5e7bf473c0 100644 --- a/docs/htmldocs/printing.html +++ b/docs/htmldocs/printing.html @@ -1,157 +1,130 @@ -<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 18. Classical Printing Support</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="samba-doc.html" title="SAMBA Project Documentation"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="previous" href="msdfs.html" title="Chapter 17. Hosting a Microsoft Distributed File System tree on Samba"><link rel="next" href="CUPS-printing.html" title="Chapter 19. CUPS Printing Support in Samba 3.0"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 18. Classical Printing Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="msdfs.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="CUPS-printing.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="printing"></a>Chapter 18. Classical Printing Support</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Kurt</span> <span class="surname">Pfeifle</span></h3><div class="affiliation"><span class="orgname"> Danka Deutschland GmbH <br></span><div class="address"><p><tt class="email"><<a href="mailto:kpfeifle@danka.de">kpfeifle@danka.de</a>></tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="othername">(Jerry)</span> <span class="surname">Carter</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email"><<a href="mailto:jerry@samba.org">jerry@samba.org</a>></tt></p></div></div></div></div><div><p class="pubdate">May 31, 2003</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="printing.html#id2912941">Features and Benefits</a></dt><dt><a href="printing.html#id2913045">Technical Introduction</a></dt><dd><dl><dt><a href="printing.html#id2913083">What happens if you send a Job from a Client</a></dt><dt><a href="printing.html#id2913154">Printing Related Configuration Parameters</a></dt><dt><a href="printing.html#id2913251">Parameters Recommended for Use</a></dt></dl></dd><dt><a href="printing.html#id2913718">A simple Configuration to Print</a></dt><dd><dl><dt><a href="printing.html#id2913883">Verification of "Settings in Use" with testparm</a></dt><dt><a href="printing.html#id2914010">A little Experiment to warn you</a></dt></dl></dd><dt><a href="printing.html#id2914370">Extended Sample Configuration to Print</a></dt><dt><a href="printing.html#id2914701">Detailed Explanation of the Example's Settings</a></dt><dd><dl><dt><a href="printing.html#id2914714">The [global] Section</a></dt><dt><a href="printing.html#id2915245">The [printers] Section</a></dt><dt><a href="printing.html#id2915706">Any [my_printer_name] Section</a></dt><dt><a href="printing.html#id2916027">Print Commands</a></dt><dt><a href="printing.html#id2916108">Default Print Commands for various UNIX Print Subsystems</a></dt><dt><a href="printing.html#id2916791">Setting up your own Print Commands</a></dt></dl></dd><dt><a href="printing.html#id2917131">Innovations in Samba Printing since 2.2</a></dt><dd><dl><dt><a href="printing.html#id2917292">Client Drivers on Samba Server for Point'n'Print</a></dt><dt><a href="printing.html#id2917453">The [printer$] Section is removed from Samba 3</a></dt><dt><a href="printing.html#id2917566">Creating the [print$] Share</a></dt><dt><a href="printing.html#id2917756">Parameters in the [print$] Section</a></dt><dt><a href="printing.html#id2918066">Subdirectory Structure in [print$]</a></dt></dl></dd><dt><a href="printing.html#id2918239">Installing Drivers into [print$]</a></dt><dd><dl><dt><a href="printing.html#id2918333">Setting Drivers for existing Printers with a Client GUI</a></dt><dt><a href="printing.html#id2918531">Setting Drivers for existing Printers with -rpcclient</a></dt></dl></dd><dt><a href="printing.html#id2920241">Client Driver Install Procedure</a></dt><dd><dl><dt><a href="printing.html#id2920260">The first Client Driver Installation</a></dt><dt><a href="printing.html#id2920462">IMPORTANT! Setting Device Modes on new Printers</a></dt><dt><a href="printing.html#id2920763">Further Client Driver Install Procedures</a></dt><dt><a href="printing.html#id2920857">Always make first Client Connection as root or "printer admin"</a></dt></dl></dd><dt><a href="printing.html#id2921029">Other Gotchas</a></dt><dd><dl><dt><a href="printing.html#id2921063">Setting Default Print Options for the Client Drivers</a></dt><dt><a href="printing.html#id2921530">Supporting large Numbers of Printers</a></dt><dt><a href="printing.html#id2921841">Adding new Printers with the Windows NT APW</a></dt><dt><a href="printing.html#id2922136">Weird Error Message Cannot connect under a -different Name</a></dt><dt><a href="printing.html#id2922236">Be careful when assembling Driver Files</a></dt><dt><a href="printing.html#id2922594">Samba and Printer Ports</a></dt><dt><a href="printing.html#id2922687">Avoiding the most common Misconfigurations of the Client Driver</a></dt></dl></dd><dt><a href="printing.html#id2922712">The Imprints Toolset</a></dt><dd><dl><dt><a href="printing.html#id2922768">What is Imprints?</a></dt><dt><a href="printing.html#id2922810">Creating Printer Driver Packages</a></dt><dt><a href="printing.html#id2922828">The Imprints Server</a></dt><dt><a href="printing.html#id2922853">The Installation Client</a></dt></dl></dd><dt><a href="printing.html#id2923008">Add Network Printers at Logon without User Interaction</a></dt><dt><a href="printing.html#id2923342">The addprinter command</a></dt><dt><a href="printing.html#id2923388">Migration of "Classical" printing to Samba</a></dt><dt><a href="printing.html#id2923561">Publishing Printer Information in Active Directory or LDAP</a></dt><dt><a href="printing.html#id2923575">Common Errors</a></dt><dd><dl><dt><a href="printing.html#id2923582">I give my root password but I don't get access</a></dt><dt><a href="printing.html#id2923615">My printjobs get spooled into the spooling directory, but then get lost</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2912941"></a>Features and Benefits</h2></div></div><div></div></div><p> -Printing is often a mission-critical service for the users. Samba can +<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 18. Classical Printing Support</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="SAMBA Project Documentation"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="previous" href="msdfs.html" title="Chapter 17. Hosting a Microsoft Distributed File System tree on Samba"><link rel="next" href="CUPS-printing.html" title="Chapter 19. CUPS Printing Support"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 18. Classical Printing Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="msdfs.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="CUPS-printing.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="printing"></a>Chapter 18. Classical Printing Support</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Kurt</span> <span class="surname">Pfeifle</span></h3><div class="affiliation"><span class="orgname"> Danka Deutschland GmbH <br></span><div class="address"><p><tt class="email"><<a href="mailto:kpfeifle@danka.de">kpfeifle@danka.de</a>></tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="othername">(Jerry)</span> <span class="surname">Carter</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email"><<a href="mailto:jerry@samba.org">jerry@samba.org</a>></tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email"><<a href="mailto:jht@samba.org">jht@samba.org</a>></tt></p></div></div></div></div><div><p class="pubdate">May 31, 2003</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="printing.html#id2920666">Features and Benefits</a></dt><dt><a href="printing.html#id2920765">Technical Introduction</a></dt><dd><dl><dt><a href="printing.html#id2920831">Client to Samba Print Job Processing</a></dt><dt><a href="printing.html#id2920903">Printing Related Configuration Parameters</a></dt></dl></dd><dt><a href="printing.html#id2920998">Simple Print Configuration</a></dt><dd><dl><dt><a href="printing.html#id2921211">Verifing Configuration with testparm</a></dt><dt><a href="printing.html#id2921327">Rapid Configuration Validation</a></dt></dl></dd><dt><a href="printing.html#id2921667">Extended Printing Configuration</a></dt><dd><dl><dt><a href="printing.html#id2922020">Detailed Explanation Settings</a></dt></dl></dd><dt><a href="printing.html#id2924414">Printing Developments Since Samba-2.2</a></dt><dd><dl><dt><a href="printing.html#id2924566">Point'n'Print Client Drivers on Samba Servers</a></dt><dt><a href="printing.html#id2924710">The Obsoleted [printer$] Section</a></dt><dt><a href="printing.html#id2924810">Creating the [print$] Share</a></dt><dt><a href="printing.html#id2925021">[print$] Section Parameters</a></dt><dt><a href="printing.html#id2925355">The [print$] Share Directory</a></dt></dl></dd><dt><a href="printing.html#id2925525">Installing Drivers into [print$]</a></dt><dd><dl><dt><a href="printing.html#id2925644">Add Printer Wizard Driver Installation</a></dt><dt><a href="printing.html#inst-rpc">Installing Print Drivers Using rpcclient</a></dt></dl></dd><dt><a href="printing.html#id2927518">Client Driver Installation Procedure</a></dt><dd><dl><dt><a href="printing.html#id2927537">First Client Driver Installation</a></dt><dt><a href="printing.html#id2927769">Setting Device Modes on New Printers</a></dt><dt><a href="printing.html#id2928112">Additional Client Driver Installation</a></dt><dt><a href="printing.html#id2928220">Always Make First Client Connection as root or printer admin</a></dt></dl></dd><dt><a href="printing.html#id2928404">Other Gotchas</a></dt><dd><dl><dt><a href="printing.html#id2928430">Setting Default Print Options for Client Drivers</a></dt><dt><a href="printing.html#id2928854">Supporting Large Numbers of Printers</a></dt><dt><a href="printing.html#id2929151">Adding New Printers with the Windows NT APW</a></dt><dt><a href="printing.html#id2929458">Error Message: Cannot connect under a different Name</a></dt><dt><a href="printing.html#id2929564">Take Care When Assembling Driver Files</a></dt><dt><a href="printing.html#id2929923">Samba and Printer Ports</a></dt><dt><a href="printing.html#id2930008">Avoiding Common Client Driver Misconfiguration</a></dt></dl></dd><dt><a href="printing.html#id2930033">The Imprints Toolset</a></dt><dd><dl><dt><a href="printing.html#id2930071">What is Imprints?</a></dt><dt><a href="printing.html#id2930113">Creating Printer Driver Packages</a></dt><dt><a href="printing.html#id2930132">The Imprints Server</a></dt><dt><a href="printing.html#id2930153">The Installation Client</a></dt></dl></dd><dt><a href="printing.html#id2930314">Adding Network Printers without User Interaction</a></dt><dt><a href="printing.html#id2930639">The addprinter Command</a></dt><dt><a href="printing.html#id2930686">Migration of Classical Printing to Samba</a></dt><dt><a href="printing.html#id2930861">Publishing Printer Information in Active Directory or LDAP</a></dt><dt><a href="printing.html#id2930884">Common Errors</a></dt><dd><dl><dt><a href="printing.html#id2930892">I Give My Root Password but I Do Not Get Access</a></dt><dt><a href="printing.html#id2930943">My Print Jobs Get Spooled into the Spooling Directory, but Then Get Lost</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2920666"></a>Features and Benefits</h2></div></div><div></div></div><p> +Printing is often a mission-critical service for the users. Samba can provide this service reliably and seamlessly for a client network consisting of Windows workstations. </p><p> -A Samba print service may be run on a Standalone or a Domain -member server, side by side with file serving functions, or on a -dedicated print server. It can be made as tight or as loosely secured -as needs dictate. Configurations may be simple or complex. Available -authentication schemes are essentially the same as described for file -services in previous chapters. Overall, Samba's printing support is -now able to replace an NT or Windows 2000 print server full-square, -with additional benefits in many cases. Clients may download and -install drivers and printers through their familiar "Point'n'Print" -mechanism. Printer installations executed by "Logon Scripts" are no -problem. Administrators can upload and manage drivers to be used by -clients through the familiar "Add Printer Wizard". As an additional -benefit, driver and printer management may be run from the command line -or through scripts, making it more efficient in case of large numbers -of printers. If a central accounting of print jobs (tracking every -single page and supplying the raw data for all sorts of statistical -reports) is required, this is best supported by CUPS as the print -subsystem underneath the Samba hood. +A Samba print service may be run on a Stand-alone or Domain Member server, +side by side with file serving functions, or on a dedicated print server. +It can be made as tight or as loosely secured as needs dictate. Configurations +may be simple or complex. Available authentication schemes are essentially +the same as described for file services in previous chapters. Overall, +Samba's printing support is now able to replace an NT or Windows 2000 +print server full-square, with additional benefits in many cases. Clients +may download and install drivers and printers through their familiar +“<span class="quote">Point'n'Print</span>” mechanism. Printer installations executed by +“<span class="quote">Logon Scripts</span>” are no problem. Administrators can upload and +manage drivers to be used by clients through the familiar “<span class="quote">Add Printer +Wizard</span>”. As an additional benefit, driver and printer management may +be run from the command line or through scripts, making it more efficient +in case of large numbers of printers. If a central accounting of print jobs +(tracking every single page and supplying the raw data for all sorts of +statistical reports) is required, this function is best supported by +the newer Common UNIX Printing System (CUPS) +as the print subsystem underneath the Samba hood. </p><p> -This chapter deals with the foundations of Samba printing, as they -implemented by the more traditional UNIX (BSD- and System V-style) -printing systems. Many things apply to CUPS, the newer Common UNIX -Printing System, too; so if you use CUPS, you might be tempted to jump -to the next chapter -- but you will certainly miss a few things if you -do so. Better to read this chapter too. +This chapter deals with the foundations of Samba printing as they +are implemented by the more traditional UNIX (BSD- and System V-style) +printing systems. Many things covered in this chapter apply also to CUPS. +If you use CUPS, you may be tempted +to jump to the next chapter but you will certainly miss a few things if +you do. It is recommended that you read this chapter as well as <link linkend="CUPS-printing">. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> -Most of the given examples have been verified on Windows XP +Most of the following examples have been verified on Windows XP Professional clients. Where this document describes the responses to -commands given, bear in mind that Windows 2000 clients are very -similar, but may differ in details. Windows NT is somewhat different +commands given, bear in mind that Windows 200x/XP clients are quite +similar, but may differ in minor details. Windows NT is somewhat different again. -</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2913045"></a>Technical Introduction</h2></div></div><div></div></div><p> -Samba's printing support always relies on the installed print -subsystem of the UNIX OS it runs on. Samba is a "middleman". It takes -printfiles from Windows (or other SMB) clients and passes them to the -real printing system for further processing. Therefore it needs to -"talk" to two sides: to the Windows print clients and to the UNIX -printing system. Hence we must differentiate between the various -client OS types each of which behave differently, as well as the -various UNIX print subsystems, which themselves have different -features and are accessed differently. This part of the Samba HOWTO -Collection deals with the "traditional" way of UNIX printing first; -the next chapter covers in great detail the more modern -<span class="emphasis"><em>Common UNIX Printing System</em></span> -(CUPS). - -</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>CUPS users, be warned: don't just jump on to the next -chapter. You might miss important information contained only -here!</p></div><p> -</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2913083"></a>What happens if you send a Job from a Client</h3></div></div><div></div></div><p> -To successfully print a job from a Windows client via a Samba -print server to a UNIX printer, there are 6 (potentially 7) -stages: -</p><div class="orderedlist"><ol type="1"><li><p>Windows opens a connection to the printer share</p></li><li><p>Samba must authenticate the user</p></li><li><p>Windows sends a copy of the printfile over the network -into Samba's spooling area</p></li><li><p>Windows closes the connection again</p></li><li><p>Samba invokes the print command to hand the file over -to the UNIX print subsystem's spooling area</p></li><li><p>The UNIX print subsystem processes the print -job</p></li><li><p>The printfile may need to be explicitly deleted -from the Samba spooling area.</p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2913154"></a>Printing Related Configuration Parameters</h3></div></div><div></div></div><p> -There are a number of configuration parameters in - controlling Samba's printing -behaviour. Please also refer to the man page for smb.conf to -acquire an overview about these. As with other parameters, there are -Global Level (tagged with a "<span class="emphasis"><em>G</em></span>" in the listings) and -Service Level ("<span class="emphasis"><em>S</em></span>") parameters. -</p><div class="variablelist"><dl><dt><span class="term">Service Level Parameters</span></dt><dd><p>These <span class="emphasis"><em>may</em></span> go into the -<i class="parameter"><tt>[global]</tt></i> section of <tt class="filename">smb.conf</tt>. -In this case they define the default -behaviour of all individual or service level shares (provided those -don't have a different setting defined for the same parameter, thus -overriding the global default).</p></dd><dt><span class="term">Global Parameters</span></dt><dd><p>These <span class="emphasis"><em>may not</em></span> go into individual -shares. If they go in by error, the "testparm" utility can discover -this (if you run it) and tell you so.</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2913251"></a>Parameters Recommended for Use</h3></div></div><div></div></div><p>The following <tt class="filename">smb.conf</tt> parameters directly -related to printing are used in Samba. See also the -<tt class="filename">smb.conf</tt> man page for detailed explanations: -</p><p>Global level parameters: <a class="indexterm" name="id2913280"></a><i class="parameter"><tt>addprinter command</tt></i>, -<a class="indexterm" name="id2913295"></a><i class="parameter"><tt>deleteprinter command</tt></i>, -<a class="indexterm" name="id2913310"></a><i class="parameter"><tt>disable spoolss</tt></i>, -<a class="indexterm" name="id2913324"></a><i class="parameter"><tt>enumports command</tt></i>, -<a class="indexterm" name="id2913338"></a><i class="parameter"><tt>load printers</tt></i>, -<a class="indexterm" name="id2913352"></a><i class="parameter"><tt>lpq cache time</tt></i>, -<a class="indexterm" name="id2913366"></a><i class="parameter"><tt>os2 driver map</tt></i>, -<a class="indexterm" name="id2913380"></a><i class="parameter"><tt>printcap name</tt></i>, <a class="indexterm" name="id2913394"></a><i class="parameter"><tt>printcap</tt></i>, -<a class="indexterm" name="id2913407"></a><i class="parameter"><tt>show add printer wizard</tt></i>, -<a class="indexterm" name="id2913422"></a><i class="parameter"><tt>total print jobs</tt></i>, -<a class="indexterm" name="id2913436"></a><i class="parameter"><tt>use client driver</tt></i>. -</p><p>Service level parameters: <a class="indexterm" name="id2913454"></a><i class="parameter"><tt>hosts allow</tt></i>, -<a class="indexterm" name="id2913468"></a><i class="parameter"><tt>hosts deny</tt></i>, -<a class="indexterm" name="id2913481"></a><i class="parameter"><tt>lppause command</tt></i>, -<a class="indexterm" name="id2913496"></a><i class="parameter"><tt>lpq command</tt></i>, -<a class="indexterm" name="id2913509"></a><i class="parameter"><tt>lpresume command</tt></i>, -<a class="indexterm" name="id2913523"></a><i class="parameter"><tt>lprm command</tt></i>, -<a class="indexterm" name="id2913537"></a><i class="parameter"><tt>max print jobs</tt></i>, -<a class="indexterm" name="id2913551"></a><i class="parameter"><tt>min print space</tt></i>, -<a class="indexterm" name="id2913565"></a><i class="parameter"><tt>print command</tt></i>, -<a class="indexterm" name="id2913579"></a><i class="parameter"><tt>printable</tt></i>, <a class="indexterm" name="id2913593"></a><i class="parameter"><tt>print ok </tt></i>, -<a class="indexterm" name="id2913606"></a><i class="parameter"><tt>printer name</tt></i>, <a class="indexterm" name="id2913621"></a><i class="parameter"><tt>printer</tt></i>, -<a class="indexterm" name="id2913634"></a><i class="parameter"><tt>printer admin</tt></i>, -<a class="indexterm" name="id2913648"></a><i class="parameter"><tt>printing</tt></i> = [cups|bsd|lprng...], -<a class="indexterm" name="id2913662"></a><i class="parameter"><tt>queuepause command</tt></i>, -<a class="indexterm" name="id2913676"></a><i class="parameter"><tt>queueresume command</tt></i>, -<a class="indexterm" name="id2913690"></a><i class="parameter"><tt>total print jobs</tt></i>. +</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2920765"></a>Technical Introduction</h2></div></div><div></div></div><p> +Samba's printing support always relies on the installed print subsystem +of the UNIX OS it runs on. Samba is a “<span class="quote">middleman.</span>” It takes +print files from Windows (or other SMB) clients and passes them to the real +printing system for further processing, therefore, it needs to communicate with +both sides: the Windows print clients and the UNIX printing system. Hence, we +must differentiate between the various client OS types, each of which behave +differently, as well as the various UNIX print subsystems, which themselves +have different features and are accessed differently. +</p><p> +This deals with the traditional way of UNIX printing. The next chapter +covers in great detail the more modern <span class="emphasis"><em>Common UNIX Printing +System</em></span> (CUPS). +</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>CUPS users, be warned: do not just jump on to the next +chapter. You might miss important information only found here! +</p></div><p> +It is apparent from postings on the Samba mailing list that print configuration +is one of the most problematic aspects of Samba administration today. Many +new Samba administrators have the impression that Samba performs some sort +of print processing. Rest assured, Samba does not peform any type of print +processing. It does not do any form of print filtering. </p><p> -Samba's printing support implements the Microsoft Remote Procedure -Calls (MS-RPC) methods for printing. These are used by Windows NT (and -later) print servers. The old "LanMan" protocol is still supported as -a fallback resort, and for older clients to use. More details will -follow further beneath. -</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2913718"></a>A simple Configuration to Print</h2></div></div><div></div></div><p> -Here is a very simple example configuration for print related settings -in the file. If you compare it with your own system's , you probably find some -additional parameters included there (as pre-configured by your OS -vendor). Further below is a discussion and explanation of the -parameters. Note, that this example doesn't use many parameters. +Samba obtains from its clients a data stream (print job) that it spools to a +local spool area. When the entire print job has been received, Samba invokes +a local UNIX/Linux print command and passes the spooled file to it. It is +up to the local system printing subsystems to correctly process the print +job and to submit it to the printer. +</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2920831"></a>Client to Samba Print Job Processing</h3></div></div><div></div></div><p> +Successful printing from a Windows client via a Samba print server to a UNIX +printer involves six (potentially seven) stages: +</p><div class="orderedlist"><ol type="1"><li><p>Windows opens a connection to the printer share.</p></li><li><p>Samba must authenticate the user.</p></li><li><p>Windows sends a copy of the print file over the network +into Samba's spooling area.</p></li><li><p>Windows closes the connection.</p></li><li><p>Samba invokes the print command to hand the file over +to the UNIX print subsystem's spooling area.</p></li><li><p>The UNIX print subsystem processes the print job.</p></li><li><p>The print file may need to be explicitly deleted +from the Samba spooling area. This item depends on your print spooler +configuration settings.</p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2920903"></a>Printing Related Configuration Parameters</h3></div></div><div></div></div><p> +There are a number of configuration parameters to control Samba's +printing behavior. Please refer to the man page for <tt class="filename">smb.conf</tt> for an +overview of these. As with other parameters, there are Global Level +(tagged with a <span class="emphasis"><em>G</em></span> in the listings) and Service Level +(<span class="emphasis"><em>S</em></span>) parameters. +</p><div class="variablelist"><dl><dt><span class="term">Global Parameters</span></dt><dd><p> These <span class="emphasis"><em>may not</em></span> go into + individual share definitions. If they go in by error, + the <b class="command">testparm</b> utility can discover this + (if you run it) and tell you so. + </p></dd><dt><span class="term">Service Level Parameters</span></dt><dd><p> These may be specified in the + <i class="parameter"><tt>[global]</tt></i> section of <tt class="filename">smb.conf</tt>. + In this case they define the default behavior of all individual + or service level shares (provided they do not have a different + setting defined for the same parameter, thus overriding the + global default). + </p></dd></dl></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2920998"></a>Simple Print Configuration</h2></div></div><div></div></div><p> +<link linkend="simpleprc"> shows a simple printing configuration. +If you compare this with your own, you may find +additional parameters that have been pre-configured by your OS +vendor. Below is a discussion and explanation of the +parameters. This example does not use many parameters. However, in many environments these are enough to provide a valid -<tt class="filename">smb.conf</tt> file which enables all clients to print. -</p><div class="example"><a name="id2913746"></a><p class="title"><b>Example 18.1. Simple configuration with BSD printing</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><i class="parameter"><tt>printing = bsd</tt></i></td></tr><tr><td><i class="parameter"><tt>load printers = yes</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>public = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>writable = no</tt></i></td></tr></table></div><p> -This is only an example configuration. Samba assigns default values to all -configuration parameters. On the whole the defaults are conservative and -sensible. When a parameter is specified in the <tt class="filename">smb.conf</tt> file this overwrites -the default value. The <b class="command">testparm</b> utility when run as root -is capable of reporting all setting, both default as well as <tt class="filename">smb.conf</tt> file -settings. <b class="command">Testparm</b> gives warnings for all mis-configured -settings. The complete output is easily 340 lines and more, so you may want -to pipe it through a pager program. +<tt class="filename">smb.conf</tt> file that enables all clients to print. +</p><p> +</p><div class="example"><a name="simpleprc"></a><p class="title"><b>Example 18.1. Simple configuration with BSD printing</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><i class="parameter"><tt>printing = bsd</tt></i></td></tr><tr><td><i class="parameter"><tt>load printers = yes</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>public = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>writable = no</tt></i></td></tr></table></div><p> +This is only an example configuration. Samba assigns default values to +all configuration parameters. The defaults are conservative +and sensible. When a parameter is specified in the <tt class="filename">smb.conf</tt> file, this +overwrites the default value. The <b class="command">testparm</b> utility when +run as root is capable of reporting all setting, both default as well as +<tt class="filename">smb.conf</tt> file settings. <b class="command">Testparm</b> gives warnings for all +misconfigured settings. The complete output is easily 340 lines and more, +so you may want to pipe it through a pager program. </p><p> The syntax for the configuration file is easy to grasp. You should -know that is not very picky about its -syntax. It has been explained elsewhere in this document. A short -reminder: It even tolerates some spelling errors (like "browsable" -instead of "browseable"). Most spelling is case-insensitive. Also, you -can use "Yes|No" or "True|False" for boolean settings. Lists of names +know that is not very picky about its syntax. As has been explained +elsewhere in this document, Samba tolerates some spelling errors (such +as <a class="indexterm" name="id2921166"></a><i class="parameter"><tt>browsable</tt></i> instead of +<a class="indexterm" name="id2921181"></a><i class="parameter"><tt>browseable</tt></i>), and spelling is +case-insensitive. It is permissible to use <i class="parameter"><tt>Yes/No</tt></i> +or <i class="parameter"><tt>True/False</tt></i> for Boolean settings. Lists of names may be separated by commas, spaces or tabs. -</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2913883"></a>Verification of "Settings in Use" with <b class="command">testparm</b></h3></div></div><div></div></div><p> -To see all (or at least most) printing related settings in Samba, -including the implicitly used ones, try the command outlined below -(hit "ENTER" twice!). It greps for all occurrences of "lp", "print", -"spool", "driver", "ports" and "[" in testparm's output and gives you -a nice overview about the running smbd's print configuration. (Note -that this command does not show individually created printer shares, -or the spooling paths in each case). Here is the output of my Samba -setup, with exactly the same settings in -as shown above: +</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2921211"></a>Verifing Configuration with <b class="command">testparm</b></h3></div></div><div></div></div><p> +To see all (or at least most) printing-related settings in Samba, including +the implicitly used ones, try the command outlined below. This command greps +for all occurrences of <tt class="constant">lp, print, spool, driver, ports</tt> +and <tt class="constant">[</tt> in testparms output. This provides a convenient +overview of the running <b class="command">smbd</b> print configuration. This +command does not show individually created printer shares or the spooling +paths they may use. Here is the output of my Samba setup, with settings +shown in <link linkend="simpleprc">: </p><pre class="screen"> -<tt class="prompt">root# </tt><b class="userinput"><tt>testparm -v | egrep "(lp|print|spool|driver|ports|\[)"</tt></b> - Load smb config files from /etc/samba/smb.conf.simpleprinting - Processing section "[homes]" - Processing section "[printers]" +<tt class="prompt">root# </tt><b class="userinput"><tt>testparm -s -v | egrep "(lp|print|spool|driver|ports|\[)"</tt></b> + Load smb config files from /etc/samba/smb.conf + Processing section "[homes]" + Processing section "[printers]" [global] smb ports = 445 139 @@ -183,73 +156,66 @@ as shown above: [printers] path = /var/spool/samba printable = Yes - </pre><p> +</p><p> You can easily verify which settings were implicitly added by Samba's -default behaviour. <span class="emphasis"><em>Don't forget about this point: it may +default behavior. <span class="emphasis"><em>Remember: it may be important in your future dealings with Samba.</em></span> -</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> testparm in samba 3 behaves differently from 2.2.x: used -without the "-v" switch it only shows you the settings actually -written into ! To see the complete -configuration used, add the "-v" parameter to testparm.</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2914010"></a>A little Experiment to warn you</h3></div></div><div></div></div><p> +</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> testparm in Samba-3 behaves differently from that in 2.2.x: used +without the “<span class="quote">-v</span>” switch it only shows you the settings actually +written into! To see the complete +configuration used, add the “<span class="quote">-v</span>” parameter to testparm.</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2921327"></a>Rapid Configuration Validation</h3></div></div><div></div></div><p> Should you need to troubleshoot at any stage, please always come back -to this point first and verify if "testparm" shows the parameters you -expect! To give you an example from personal experience as a warning, -try to just "comment out" the <a class="indexterm" name="id2914020"></a><i class="parameter"><tt>load printers</tt></i>" +to this point first and verify if <b class="command">testparm</b> shows the parameters you +expect. To give you a warning from personal experience, +try to just comment out the <a class="indexterm" name="id2921350"></a><i class="parameter"><tt>load printers</tt></i> parameter. If your 2.2.x system behaves like mine, you'll see this: </p><pre class="screen"> -<tt class="prompt">root# </tt>grep "load printers" /etc/samba/smb.conf - # load printers = Yes - # This setting is commented ooouuuuut!! +<tt class="prompt">root# </tt>grep "load printers" /etc/samba/smb.conf + # load printers = Yes + # This setting is commented out!! -<tt class="prompt">root# </tt>testparm -v /etc/samba/smb.conf | egrep "(load printers)" +<tt class="prompt">root# </tt>testparm -v /etc/samba/smb.conf | egrep "(load printers)" load printers = Yes - </pre><p> -Despite my imagination that the commenting out of this setting should -prevent Samba from publishing my printers, it still did! Oh Boy -- it -cost me quite some time to find out the reason. But I am not fooled -any more... at least not by this ;-) +I assumed that commenting out of this setting should prevent Samba from +publishing my printers, but it still did. It took some time to figure out +the reason. But I am no longer fooled ... at least not by this. </p><pre class="screen"> -<tt class="prompt">root# </tt><b class="userinput"><tt>grep -A1 "load printers" /etc/samba/smb.conf</tt></b> +<tt class="prompt">root# </tt><b class="userinput"><tt>grep -A1 "load printers" /etc/samba/smb.conf</tt></b> load printers = No - # This setting is what I mean!! - # load printers = Yes - # This setting is commented ooouuuuut!! + # The above setting is what I want! + # load printers = Yes + # This setting is commented out! -<tt class="prompt">root# </tt><b class="userinput"><tt>testparm -v smb.conf.simpleprinting | egrep "(load printers)"</tt></b> +<tt class="prompt">root# </tt><b class="userinput"><tt>testparm -s -v smb.conf.simpleprinting | egrep "(load printers)"</tt></b> load printers = No </pre><p> -Only when setting the parameter explicitly to -"<a class="indexterm" name="id2914136"></a><i class="parameter"><tt>load printers</tt></i> = No" -would Samba recognize my intentions. So my strong advice is: -</p><div class="itemizedlist"><ul type="disc"><li><p>Never rely on "commented out" parameters!</p></li><li><p>Always set it up explicitly as you intend it to +Only when the parameter is explicitly set to +<a class="indexterm" name="id2921441"></a><i class="parameter"><tt>load printers</tt></i> = No +would Samba conform with my intentions. So, my strong advice is: +</p><div class="itemizedlist"><ul type="disc"><li><p>Never rely on commented out parameters.</p></li><li><p>Always set parameters explicitly as you intend them to behave.</p></li><li><p>Use <b class="command">testparm</b> to uncover hidden -settings which might not reflect your intentions.</p></li></ul></div><p> -You can have a working Samba print configuration with this -minimal : +settings that might not reflect your intentions.</p></li></ul></div><p> +The following is the most minimal configuration file: </p><pre class="screen"> <tt class="prompt">root# </tt><b class="userinput"><tt>cat /etc/samba/smb.conf-minimal</tt></b> [printers] - </pre><p> -This example should show you that you can use testparm to test any -filename for fitness as a Samba configuration. Actually, we want to -encourage you <span class="emphasis"><em>not</em></span> to change your - on a working system (unless you know -exactly what you are doing)! Don't rely on an assumption that changes -will only take effect after you re-start smbd! This is not the -case. Samba re-reads its every 60 -seconds and on each new client connection. You might have to face -changes for your production clients that you didn't intend to apply at -this time! You will now note a few more interesting things. Let's now -ask <b class="command">testparm</b> what the Samba print configuration -would be, if you used this minimalistic file as your real -: +This example should show that you can use testparm to test any Samba +configuration file. Actually, we encourage you <span class="emphasis"><em>not</em></span> +to change your working system (unless you know exactly what you are +doing). Don't rely on the assumption that changes will only take effect after +you re-start smbd! This is not the case. Samba re-reads it every 60 seconds +and on each new client connection. You might have to face changes for your +production clients that you didn't intend to apply. You will now +note a few more interesting things; <b class="command">testparm</b> is useful to +identify what the Samba print configuration would be if you used this minimalistic +configuration. Here is what you can expect to find: </p><pre class="screen"> -<tt class="prompt">root# </tt><b class="userinput"><tt>testparm -v smb.conf-minimal | egrep "(print|lpq|spool|driver|ports|[)"</tt></b> - Processing section "[printers]" +<tt class="prompt">root# </tt><b class="userinput"><tt>testparm -v smb.conf-minimal | egrep "(print|lpq|spool|driver|ports|[)"</tt></b> + Processing section "[printers]" WARNING: [printers] service MUST be printable! No path in service printers - using /tmp @@ -272,675 +238,568 @@ would be, if you used this minimalistic file as your real lpq command = lpq -P%p printer name = use client driver = No + [printers] printable = Yes </pre><p> -testparm issued 2 warnings: -</p><div class="itemizedlist"><ul type="disc"><li><p>because we didn't specify the -<i class="parameter"><tt>[printers]</tt></i> section as printable, -and</p></li><li><p>because we didn't tell it which spool directory to -use.</p></li></ul></div><p> -However, this was not fatal, and samba will default to values that -will work here. Please, don't rely on this and don't use this -example! This was only meant to make you careful to design and specify -your setup to be what you really want it to be. The outcome on your -system may vary for some parameters, since you may have a Samba built -with a different compile-time configuration. -<span class="emphasis"><em>Warning:</em></span> don't put a comment sign <span class="emphasis"><em>at -the end</em></span> of a valid line. It -will cause the parameter to be ignored (just as if you had put the -comment sign at the front). At first I regarded this as a bug in my -Samba version(s). But the man page states: “<span class="quote">Internal whitespace -in a parameter value is retained verbatim.</span>” This means that a -line consisting of, for example, -</p><table class="simplelist" border="0" summary="Simple list"><tr><td># This defines LPRng as the printing system"</td></tr><tr><td><i class="parameter"><tt>printing = lprng</tt></i></td></tr></table><p> -will regard the whole of the string after the "=" -sign as the value you want to define. And this is an invalid value -that will be ignored, and a default value used instead.] -</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2914370"></a>Extended Sample Configuration to Print</h2></div></div><div></div></div><p> - In <a href="printing.html#extbsdpr" title="Example 18.2. Extended configuration with BSD printing">the extended BSD configuration example</a> we show a more verbose example configuration for print related - settings in BSD-printing style environment . Below is a discussion -and explanation of the various parameters. We chose to use BSD-style -printing here, because we guess it is still the most commonly used -system on legacy Linux installations (new installs now predominantly -have CUPS, which is discussed entirely in the next chapter of this -document). Note, that this example explicitly names many parameters -which don't need to be specified because they are set by default. You -might be able to do with a leaner <tt class="filename">smb.conf</tt> file.</p><div class="example"><a name="extbsdpr"></a><p class="title"><b>Example 18.2. Extended configuration with BSD printing</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><i class="parameter"><tt>printing = bsd</tt></i></td></tr><tr><td><i class="parameter"><tt>load printers = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>show add printer wizard = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printcap name = /etc/printcap</tt></i></td></tr><tr><td><i class="parameter"><tt>printer admin = @ntadmin, root</tt></i></td></tr><tr><td><i class="parameter"><tt>total print jobs = 100</tt></i></td></tr><tr><td><i class="parameter"><tt>lpq cache time = 20</tt></i></td></tr><tr><td><i class="parameter"><tt>use client driver = no</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = All Printers</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba</tt></i></td></tr><tr><td><i class="parameter"><tt>browseable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>public = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>read only = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>writable = no </tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[my_printer_name]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = Printer with Restricted Access</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba_my_printer</tt></i></td></tr><tr><td><i class="parameter"><tt>printer admin = kurt</tt></i></td></tr><tr><td><i class="parameter"><tt>browseable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>writeable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>hosts allow = 0.0.0.0</tt></i></td></tr><tr><td><i class="parameter"><tt>hosts deny = turbo_xp, 10.160.50.23, 10.160.51.60</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = no</tt></i></td></tr></table></div><p> -This <span class="emphasis"><em>also</em></span> is only an example configuration. You -may not find all the settings in your own - (as pre-configured by your OS -vendor). Many configuration parameters, if not explicitly set to a -specific value, are used and set by Samba implicitly to its own -default, because these have been compiled in. To see all settings, let -root use the <b class="command">testparm</b> -utility. <b class="command">testparm</b> also gives warnings if you have -mis-configured certain things.. -</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2914701"></a>Detailed Explanation of the Example's Settings</h2></div></div><div></div></div><p> -Following is a discussion of the settings from above shown example. -</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2914714"></a>The [global] Section</h3></div></div><div></div></div><p> -The <i class="parameter"><tt>[global]</tt></i> section is one of 4 special +testparm issued two warnings: +</p><div class="itemizedlist"><ul type="disc"><li><p>We did not specify the <i class="parameter"><tt>[printers]</tt></i> section as printable.</p></li><li><p>We did not tell Samba which spool directory to use.</p></li></ul></div><p> +However, this was not fatal and Samba will default to values that will +work. Please, do not rely on this and do not use this example. This was +included to encourage you to be careful to design and specify your setup to do +precisely what you require. The outcome on your system may vary for some +parameters given, since Samba may have been built with different compile-time +options. <span class="emphasis"><em>Warning:</em></span> do not put a comment sign +<span class="emphasis"><em>at the end</em></span> of a valid line. It will cause the parameter +to be ignored (just as if you had put the comment sign at the front). At first +I regarded this as a bug in my Samba versions. But the man page clearly says: +“<span class="quote">Internal whitespace in a parameter value is retained verbatim.</span>” +This means that a line consisting of, for example: +</p><table class="simplelist" border="0" summary="Simple list"><tr><td># This defines LPRng as the printing system</td></tr><tr><td><i class="parameter"><tt>printing = lprng</tt></i></td></tr></table><p> +will regard the whole of the string after the +“<span class="quote"><tt class="constant">=</tt></span>” sign as the value you want to +define. This is an invalid value that will be ignored and a default +value will be +used in its place. +</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2921667"></a>Extended Printing Configuration</h2></div></div><div></div></div><p> +In <link linkend="extbsdpr"> we show a more verbose example configuration +for print-related settings in a BSD-style printing environment. What follows +is a discussion and explanation of the various parameters. We chose to +use BSD-style printing here because it is still the most commonly used +system on legacy UNIX/Linux installations. New installations predominantly +use CUPS, which is discussed in a separate chapter. <link linkend="extbsdpr"> explicitly +names many parameters that do not need to be specified because they are set +by default. You could use a much leaner <tt class="filename">smb.conf</tt> file. Alternately, you can use +<b class="command">testparm</b> or <b class="command">SWAT</b> to optimize the <tt class="filename">smb.conf</tt> +file to remove all parameters that are set at default. +</p><div class="example"><a name="extbsdpr"></a><p class="title"><b>Example 18.2. Extended BSD Printing Configuration</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><i class="parameter"><tt>printing = bsd</tt></i></td></tr><tr><td><i class="parameter"><tt>load printers = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>show add printer wizard = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printcap name = /etc/printcap</tt></i></td></tr><tr><td><i class="parameter"><tt>printer admin = @ntadmin, root</tt></i></td></tr><tr><td><i class="parameter"><tt>total print jobs = 100</tt></i></td></tr><tr><td><i class="parameter"><tt>lpq cache time = 20</tt></i></td></tr><tr><td><i class="parameter"><tt>use client driver = no</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = All Printers</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba</tt></i></td></tr><tr><td><i class="parameter"><tt>browseable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>public = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>read only = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>writable = no </tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[my_printer_name]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = Printer with Restricted Access</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba_my_printer</tt></i></td></tr><tr><td><i class="parameter"><tt>printer admin = kurt</tt></i></td></tr><tr><td><i class="parameter"><tt>browseable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>writeable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>hosts allow = 0.0.0.0</tt></i></td></tr><tr><td><i class="parameter"><tt>hosts deny = turbo_xp, 10.160.50.23, 10.160.51.60</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = no</tt></i></td></tr></table></div><p> +This is an example configuration. You may not find all the settings that are in +the confioguration file that was provided by the OS vendor. Samba configuration +parameters, if not explicitly set default to a sensible value. +To see all settings, as <tt class="constant">root</tt> use the <b class="command">testparm</b> +utility. <b class="command">testparm</b> gives warnings for misconfigured settings. +</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2922020"></a>Detailed Explanation Settings</h3></div></div><div></div></div><p> +The following is a discussion of the settings from above shown example. +</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2922033"></a>The [global] Section</h4></div></div><div></div></div><p> +The <i class="parameter"><tt>[global]</tt></i> section is one of four special sections (along with [<i class="parameter"><tt>[homes]</tt></i>, -<i class="parameter"><tt>[printers]</tt></i> and -<i class="parameter"><tt>[print$]</tt></i>...) It contains all parameters which -apply to the server as a whole. It is the place for parameters which -have only a "global" meaning. It may also contain service level -parameters which then define default settings for all other -sections and shares. This way you can simplify the configuration and -avoid setting the same value repeatedly. (Within each individual -section or share you may however override these globally set "share -level" settings and specify other values). -</p><div class="variablelist"><dl><dt><span class="term"><a class="indexterm" name="id2914781"></a><i class="parameter"><tt>printing</tt></i> = bsd</span></dt><dd><p> this causes Samba to use default print commands -applicable for the BSD (a.k.a. RFC 1179 style or LPR/LPD) printing -system. In general, the "printing" parameter informs Samba about the -print subsystem it should expect. Samba supports CUPS, LPD, LPRNG, -SYSV, HPUX, AIX, QNX and PLP. Each of these systems defaults to a -different <a class="indexterm" name="id2914801"></a><i class="parameter"><tt>print command</tt></i> (and other queue control -commands).</p><div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Caution</h3><p>The <a class="indexterm" name="id2914838"></a><i class="parameter"><tt>printing</tt></i> parameter is -normally a service level parameter. Since it is included here in the -<i class="parameter"><tt>[global]</tt></i> section, it will take effect for all -printer shares that are not defined differently. Samba 3 no longer -supports the SOFTQ printing system.</p></div></dd><dt><span class="term"><a class="indexterm" name="id2914868"></a><i class="parameter"><tt>load printers</tt></i> = yes</span></dt><dd><p> this tells Samba to create automatically all -available printer shares. "Available" printer shares are discovered by -scanning the printcap file. All created printer shares are also loaded -for browsing. If you use this parameter, you do not need to specify -separate shares for each printer. Each automatically created printer -share will clone the configuration options found in the -<i class="parameter"><tt>[printers]</tt></i> section. (A <i class="parameter"><tt>load printers -= no</tt></i> setting will allow you to specify each UNIX printer -you want to share separately, leaving out some you don't want to be -publicly visible and available). </p></dd><dt><span class="term"><a class="indexterm" name="id2914927"></a><i class="parameter"><tt>show add printer wizard</tt></i> = yes </span></dt><dd><p> this setting is normally -enabled by default (even if the parameter is not written into the -). It makes the <span class="guiicon">Add Printer Wizard</span> icon -show up in the <span class="guiicon">Printers</span> folder of the Samba host's -share listing (as shown in <span class="guiicon">Network Neighbourhood</span> or -by the <b class="command">net view</b> command). To disable it, you need to -explicitly set it to <tt class="constant">no</tt> (commenting it out -will not suffice!). The Add Printer Wizard lets you upload printer -drivers to the <i class="parameter"><tt>[print$]</tt></i> share and associate it -with a printer (if the respective queue exists there before the -action), or exchange a printer's driver against any other previously -uploaded driver. </p></dd><dt><span class="term"><a class="indexterm" name="id2914996"></a><i class="parameter"><tt>total print jobs</tt></i> = 100</span></dt><dd><p> this setting sets the upper limit to 100 print jobs -being active on the Samba server at any one time. Should a client -submit a job which exceeds this number, a “<span class="quote">no more space -available on server</span>” type of error message will be returned by -Samba to the client. A setting of "0" (the default) means there is -<span class="emphasis"><em>no</em></span> limit at all! -</p></dd><dt><span class="term"><a class="indexterm" name="id2915035"></a><i class="parameter"><tt>printcap name</tt></i> = /etc/printcap</span></dt><dd><p> this tells Samba where to look for a list of -available printer names. (If you use CUPS, make sure that a printcap -file is written: this is controlled by the "Printcap" directive of -<tt class="filename">cupsd.conf</tt>). -</p></dd><dt><span class="term"><a class="indexterm" name="id2915072"></a><i class="parameter"><tt>printer admin</tt></i> = @ntadmin</span></dt><dd><p> members of the ntadmin group should be able to add -drivers and set printer properties ("ntadmin" is only an example name, -it needs to be a valid UNIX group name); root is implicitly always a -<a class="indexterm" name="id2915102"></a><i class="parameter"><tt>printer admin</tt></i>. The "@" sign precedes group names in -. A printer admin can do anything to -printers via the remote administration interfaces offered by MS-RPC -(see below). Note that the <a class="indexterm" name="id2915124"></a><i class="parameter"><tt>printer admin</tt></i> -parameter is normally a share level parameter, so you may associate -different groups to different printer shares in larger installations, -if you use the <a class="indexterm" name="id2915141"></a><i class="parameter"><tt>printer admin</tt></i> parameter on the -share levels). -</p></dd><dt><span class="term"><a class="indexterm" name="id2915159"></a><i class="parameter"><tt>lpq cache time</tt></i> = 20</span></dt><dd><p> this controls the cache time for the results of the -lpq command. It prevents the lpq command being called too often and -reduces load on a heavily used print server. -</p></dd><dt><span class="term"><a class="indexterm" name="id2915186"></a><i class="parameter"><tt>use client driver</tt></i> = no</span></dt><dd><p> if set to <tt class="constant">yes</tt>, this setting only -takes effect for Win NT/2k/XP clients (and not for Win 95/98/ME). Its -default value is <tt class="constant">No</tt> (or <tt class="constant">False</tt>). -It must <span class="emphasis"><em>not</em></span> be enabled on print shares -(with a <tt class="constant">yes</tt> or <tt class="constant">true</tt> setting) which -have valid drivers installed on the Samba server! For more detailed -explanations see the man page of <tt class="filename">smb.conf</tt>. -</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2915245"></a>The [printers] Section</h3></div></div><div></div></div><p> -This is the second special section. If a section with this name -appears in the <tt class="filename">smb.conf</tt>, users are able to -connect to any printer specified in the Samba host's printcap file, -because Samba on startup then creates a printer share for every -printername it finds in the printcap file. You could regard this -section as a general convenience shortcut to share all printers with -minimal configuration. It is also a container for settings which -should apply as default to all printers. (For more details see the -<tt class="filename">smb.conf</tt> man page.) Settings inside this -container must be share level parameters. -</p><div class="variablelist"><dl><dt><span class="term"><a class="indexterm" name="id2915287"></a><i class="parameter"><tt>comment</tt></i> = All printers</span></dt><dd><p> the <a class="indexterm" name="id2915307"></a><i class="parameter"><tt>comment</tt></i> is shown next to -the share if a client queries the server, either via <span class="guiicon">Network -Neighbourhood</span> or with the <b class="command">net view</b> command to list -available shares. -</p></dd><dt><span class="term"><a class="indexterm" name="id2915340"></a><i class="parameter"><tt>printable</tt></i> = yes</span></dt><dd><p> please note well, that the -<i class="parameter"><tt>[printers]</tt></i> service <span class="emphasis"><em>must</em></span> be -declared as printable. If you specify otherwise, smbd will refuse to -load at startup. This parameter allows -connected clients to open, write to and submit spool files into the -directory specified with the <a class="indexterm" name="id2915374"></a><i class="parameter"><tt>path</tt></i> parameter for -this service. It is used by Samba to differentiate printer shares from -file shares. </p></dd><dt><span class="term"><a class="indexterm" name="id2915394"></a><i class="parameter"><tt>path</tt></i> = /var/spool/samba</span></dt><dd><p>this must point to a directory used by Samba to spool -incoming print files. <span class="emphasis"><em>It must not be the same as the spool -directory specified in the configuration of your UNIX print -subsystem!</em></span> The path would typically point to a directory -which is world writeable, with the "sticky" bit set to it. -</p></dd><dt><span class="term"><a class="indexterm" name="id2915428"></a><i class="parameter"><tt>browseable</tt></i> = no</span></dt><dd><p> this is always set to <tt class="constant">no</tt> if -<a class="indexterm" name="id2915453"></a><i class="parameter"><tt>printable</tt></i> = yes. It makes the -<i class="parameter"><tt>[printer]</tt></i> share itself invisible in the -list of available shares in a <b class="command">net view</b> command or -in the Explorer browse list. (Note that you will of course see the -individual printers). -</p></dd><dt><span class="term"><a class="indexterm" name="id2915487"></a><i class="parameter"><tt>guest ok</tt></i> = yes</span></dt><dd><p> -if set to <tt class="constant">yes</tt>, then no password is required to -connect to the printers service. Access will be granted with the -privileges of the <a class="indexterm" name="id2915513"></a><i class="parameter"><tt>guest account</tt></i>. On many systems the -guest account will map to a user named "nobody". This user is in the UNIX -passwd file with an empty password, but with no valid UNIX login. -(Note: on some systems the guest account might not have the -privilege to be able to print. Test this by logging in as your -guest user using <b class="command">su - guest</b> and run a system print -command like -</p><p><b class="userinput"><tt>lpr -P printername /etc/motd</tt></b></p></dd><dt><span class="term"><a class="indexterm" name="id2915562"></a><i class="parameter"><tt>public</tt></i> = yes</span></dt><dd><p> this is a synonym for <a class="indexterm" name="id2915582"></a><i class="parameter"><tt>guest ok</tt></i> = yes. Since we have <a class="indexterm" name="id2915596"></a><i class="parameter"><tt>guest ok</tt></i> = yes, -it really doesn't need to be here! (This leads to the interesting -question: “<span class="quote">What, if I by accident have to contradictory settings -for the same share?</span>” The answer is: the last one encountered by -Samba wins. The "winner" is shown by testparm. Testparm doesn't -complain about different settings of the same parameter for the same -share! You can test this by setting up multiple lines for the "guest -account" parameter with different usernames, and then run testparm to -see which one is actually used by Samba.) -</p></dd><dt><span class="term"><a class="indexterm" name="id2915632"></a><i class="parameter"><tt>read only</tt></i> = yes</span></dt><dd><p>this normally (for other types of shares) prevents -users creating or modifying files in the service's directory. However, -in a "printable" service, it is <span class="emphasis"><em>always</em></span> allowed to -write to the directory (if user privileges allow the connection), but -only via print spooling operations. "Normal" write operations are not -allowed. </p></dd><dt><span class="term"><a class="indexterm" name="id2915669"></a><i class="parameter"><tt>writeable</tt></i> = no</span></dt><dd><p> -synonym for <a class="indexterm" name="id2915689"></a><i class="parameter"><tt>read only</tt></i> = yes -</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2915706"></a>Any [my_printer_name] Section</h3></div></div><div></div></div><p> -If a section appears in the , which is -tagged as <a class="indexterm" name="id2915717"></a><i class="parameter"><tt>printable</tt></i> = yes, Samba presents it as -a printer share to its clients. Note, that Win95/98/ME clients may -have problems with connecting or loading printer drivers if the share -name has more than 8 characters! Also be very careful if you give a -printer the same name as an existing user or file share name: upon a -client's connection request to a certain sharename, Samba always tries -to find file shares with that name first; if it finds one, it will -connect to this and will never ultimately connect to a printer with -the same name! -</p><div class="variablelist"><dl><dt><span class="term"><a class="indexterm" name="id2915747"></a><i class="parameter"><tt>comment</tt></i> = Printer with Restricted Access</span></dt><dd><p> the comment says it all. -</p></dd><dt><span class="term"><a class="indexterm" name="id2915772"></a><i class="parameter"><tt>path</tt></i> = /var/spool/samba_my_printer</span></dt><dd><p> here we set the spooling area for this printer to -another directory than the default. It is not a requirement to set it -differently, but the option is available. -</p></dd><dt><span class="term"><a class="indexterm" name="id2915799"></a><i class="parameter"><tt>printer admin</tt></i> = kurt</span></dt><dd><p> the printer admin definition is different for this -explicitly defined printer share from the general -<i class="parameter"><tt>[printers]</tt></i> share. It is not a requirement; we -did it to show that it is possible if you want it. -</p></dd><dt><span class="term"><a class="indexterm" name="id2915832"></a><i class="parameter"><tt>browseable</tt></i> = yes</span></dt><dd><p> we also made this printer browseable (so that the -clients may conveniently find it when browsing the <span class="guiicon">Network -Neighbourhood</span>). -</p></dd><dt><span class="term"><a class="indexterm" name="id2915866"></a><i class="parameter"><tt>printable</tt></i> = yes</span></dt><dd><p>see explanation in last subsection. -</p></dd><dt><span class="term"><a class="indexterm" name="id2915889"></a><i class="parameter"><tt>writeable</tt></i> = no</span></dt><dd><p>see explanation in last subsection. -</p></dd><dt><span class="term"><a class="indexterm" name="id2915913"></a><i class="parameter"><tt>hosts allow</tt></i> = 10.160.50.,10.160.51.</span></dt><dd><p>here we exercise a certain degree of access control -by using the <a class="indexterm" name="id2915935"></a><i class="parameter"><tt>hosts allow</tt></i> and <a class="indexterm" name="id2915949"></a><i class="parameter"><tt>hosts deny</tt></i> parameters. Note, that -this is not by any means a safe bet. It is not a way to secure your -printers. This line accepts all clients from a certain subnet in a -first evaluation of access control -</p></dd><dt><span class="term"><a class="indexterm" name="id2915970"></a><i class="parameter"><tt>hosts deny</tt></i> = turbo_xp,10.160.50.23,10.160.51.60</span></dt><dd><p>all listed hosts are not allowed here (even if they -belong to the "allowed subnets"). As you can see, you could name IP -addresses as well as NetBIOS hostnames -here. -</p></dd><dt><span class="term"><a class="indexterm" name="id2916003"></a><i class="parameter"><tt>guest ok</tt></i> = no</span></dt><dd><p>this printer is not open for the guest account! -</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2916027"></a>Print Commands</h3></div></div><div></div></div><p> -In each section defining a printer (or in the -<i class="parameter"><tt>[printers]</tt></i> section), a <i class="parameter"><tt>print -command</tt></i> parameter may be defined. It sets a command to -process the files which have been placed into the Samba print spool -directory for that printer. (That spool directory was, if you -remember, set up with the <a class="indexterm" name="id2916055"></a><i class="parameter"><tt>path</tt></i> -parameter). Typically, this command will submit the spool file to the -Samba host's print subsystem, using the suitable system print -command. But there is no requirement that this needs to be the -case. For debugging purposes or some other reason you may want to do -something completely different than "print" the file. An example is a -command that just copies the print file to a temporary location for -further investigation when you need to debug printing. If you craft -your own print commands (or even develop print command shell scripts), -make sure you pay attention to the need to remove the files from the -Samba spool directory. Otherwise your hard disk may soon suffer from -shortage of free space. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2916108"></a>Default Print Commands for various UNIX Print Subsystems</h3></div></div><div></div></div><p> -You learned earlier on, that Samba in most cases uses its built-in -settings for many parameters if it can not find an explicitly stated -one in its configuration file. The same is true for the -<a class="indexterm" name="id2916122"></a><i class="parameter"><tt>print command</tt></i>. The default print command varies -depending on the <a class="indexterm" name="id2916138"></a><i class="parameter"><tt>printing</tt></i> parameter -setting. In the commands listed below, you will notice some parameters -of the form <span class="emphasis"><em>%X</em></span> where <span class="emphasis"><em>X</em></span> is -<span class="emphasis"><em>p, s, J</em></span> etc. These letters stand for -"printername", "spoolfile" and "job ID" respectively. They are -explained in more detail further below. Here is an overview (excluding -the special case of CUPS, which is discussed in the next chapter): -</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">If this setting is active...</th><th align="left">...this is used in lieu of an explicit command:</th></tr></thead><tbody><tr><td align="left"><a class="indexterm" name="id2916224"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">print command is <b class="command">lpr -r -P%p %s</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916254"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">print command is <b class="command">lp -c -P%p %s; rm %s</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916286"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">print command is <b class="command">lp -r -P%p -s %s</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916317"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">lpq command is <b class="command">lpq -P%p</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916348"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">lpq command is <b class="command">lpstat -o%p</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916378"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">lpq command is <b class="command">lpq -P%p</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916408"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">lprm command is <b class="command">lprm -P%p %j</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916439"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">lprm command is <b class="command">cancel %p-%j</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916470"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">lprm command is <b class="command">cancel %p-%j</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916500"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">lppause command is <b class="command">lp -i %p-%j -H hold</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916531"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">lppause command (...is empty)</td></tr><tr><td align="left"><a class="indexterm" name="id2916556"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">lppause command (...is empty)</td></tr><tr><td align="left"><a class="indexterm" name="id2916582"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">lpresume command is <b class="command">lp -i %p-%j -H resume</b></td></tr><tr><td align="left"><a class="indexterm" name="id2916613"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">lpresume command (...is empty)</td></tr><tr><td align="left"><a class="indexterm" name="id2916638"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">lpresume command (...is empty)</td></tr></tbody></table></div><p> -We excluded the special CUPS case here, because it is discussed in the -next chapter. Just a short summary. For <i class="parameter"><tt>printing = -CUPS</tt></i>: If SAMBA is compiled against libcups, it uses the -CUPS API to submit jobs, etc. (It is a good idea also to set -<a class="indexterm" name="id2916676"></a><i class="parameter"><tt>printcap</tt></i> = cups in case your -<tt class="filename">cupsd.conf</tt> is set to write its autogenerated -printcap file to an unusual place). Otherwise Samba maps to the System -V printing commands with the -oraw option for printing, i.e. it uses -<b class="command">lp -c -d%p -oraw; rm %s</b> With <i class="parameter"><tt>printing = -cups</tt></i> , and if SAMBA is compiled against libcups, any -manually set print command will be ignored! -</p><p> -Having listed the above mappings here, you should note that there used -to be a <span class="emphasis"><em>bug</em></span> in recent 2.2.x versions which -prevented the mapping from taking effect. It lead to the -"bsd|aix|lprng|plp" settings taking effect for all other systems, for -the most important commands (the <b class="command">print</b> command, the -<b class="command">lpq</b> command and the <b class="command">lprm</b> -command). The <b class="command">lppause</b> command and the -<b class="command">lpresume</b> command remained empty. Of course, these -commands worked on bsd|aix|lprng|plp but they didn't work on -sysv|hpux|qnx systems. To work around this bug, you need to -explicitly set the commands. Use <b class="command">testparm -v</b> to -check which command takes effect. Then check that this command is -adequate and actually works for your installed print subsystem. It is -always a good idea to explicitly set up your configuration files the -way you want them to work and not rely on any built-in defaults. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2916791"></a>Setting up your own Print Commands</h3></div></div><div></div></div><p> -After a print job has finished spooling to a service, the -<a class="indexterm" name="id2916802"></a><i class="parameter"><tt>print command</tt></i> will be used by Samba via a -<span class="emphasis"><em>system()</em></span> call to process the spool file. Usually -the command specified will submit the spool file to the host's -printing subsystem. But there is no requirement at all that this must -be the case. The print subsystem will probably not remove the spool -file on its own. So whatever command you specify on your own you -should ensure that the spool file is deleted after it has been -processed. +<i class="parameter"><tt>[printers]</tt></i> +and <i class="parameter"><tt>[print$]</tt></i>...). The +<i class="parameter"><tt>[global]</tt></i> contains all parameters which apply +to the server as a whole. It is the place for parameters that have only a +global meaning. It may also contain service level parameters that then define +default settings for all other sections and shares. This way you can simplify +the configuration and avoid setting the same value repeatedly. (Within each +individual section or share you may, however, override these globally set +share settings and specify other values). +</p><div class="variablelist"><dl><dt><span class="term"><a class="indexterm" name="id2922094"></a><i class="parameter"><tt>printing</tt></i> = bsd </span></dt><dd><p>Causes Samba to use default print commands + applicable for the BSD (also known as RFC 1179 style or LPR/LPD) printing + system. In general, the <i class="parameter"><tt>printing</tt></i> parameter informs Samba about the + print subsystem it should expect. Samba supports CUPS, LPD, LPRNG, + SYSV, HPUX, AIX, QNX, and PLP. Each of these systems defaults to a + different <a class="indexterm" name="id2922127"></a><i class="parameter"><tt>print command</tt></i> (and other queue control + commands).</p><div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Caution</h3><p>The <a class="indexterm" name="id2922147"></a><i class="parameter"><tt>printing</tt></i> parameter is + normally a service level parameter. Since it is included here in the + <i class="parameter"><tt>[global]</tt></i> section, it will take effect for all + printer shares that are not defined differently. Samba-3 no longer + supports the SOFTQ printing system.</p></div></dd><dt><span class="term"><a class="indexterm" name="id2922176"></a><i class="parameter"><tt>load printers</tt></i> = yes </span></dt><dd><p>Tells Samba to create automatically all + available printer shares. Available printer shares are discovered by + scanning the printcap file. All created printer shares are also loaded + for browsing. If you use this parameter, you do not need to specify + separate shares for each printer. Each automatically created printer + share will clone the configuration options found in the + <i class="parameter"><tt>[printers]</tt></i> section. (The <i class="parameter"><tt>load printers + = no</tt></i> setting will allow you to specify each UNIX printer + you want to share separately, leaving out some you do not want to be + publicly visible and available).</p></dd><dt><span class="term"><a class="indexterm" name="id2922227"></a><i class="parameter"><tt>show add printer wizard</tt></i> = yes </span></dt><dd><p>Setting is normally enabled by default (even if the parameter is not specified in <tt class="filename">smb.conf</tt>). + It causes the <span class="guiicon">Add Printer Wizard</span> icon to appear + in the <span class="guiicon">Printers</span> folder of the Samba host's + share listing (as shown in <span class="guiicon">Network Neighborhood</span> or + by the <b class="command">net view</b> command). To disable it, you need to + explicitly set it to <tt class="constant">no</tt> (commenting it out + will not suffice). The <i class="parameter"><tt>Add Printer Wizard</tt></i> lets you upload printer + drivers to the <i class="parameter"><tt>[print$]</tt></i> share and associate it + with a printer (if the respective queue exists before the + action), or exchange a printer's driver against any other previously + uploaded driver.</p></dd><dt><span class="term"><a class="indexterm" name="id2922312"></a><i class="parameter"><tt>total print jobs</tt></i> = 100 </span></dt><dd><p>Sets the upper limit to 100 print jobs + being active on the Samba server at any one time. Should a client + submit a job that exceeds this number, a “<span class="quote">no more space + available on server</span>” type of error message will be returned by + Samba to the client. A setting of zero (the default) means there is + <span class="emphasis"><em>no</em></span> limit at all. + </p></dd><dt><span class="term"><a class="indexterm" name="id2922350"></a><i class="parameter"><tt>printcap name</tt></i> = /etc/printcap </span></dt><dd><p>Tells Samba where to look for a list of + available printer names. Where CUPS is used, make sure that a printcap + file is written. This is controlled by the <tt class="constant">Printcap</tt> directive in the + <tt class="filename">cupsd.conf</tt> file. + </p></dd><dt><span class="term"><a class="indexterm" name="id2922389"></a><i class="parameter"><tt>printer admin</tt></i> = @ntadmin </span></dt><dd><p>Members of the ntadmin group should be able to add + drivers and set printer properties (<tt class="constant">ntadmin</tt> is only an example name, + it needs to be a valid UNIX group name); root is implicitly always a + <a class="indexterm" name="id2922416"></a><i class="parameter"><tt>printer admin</tt></i>. The @ sign precedes group names in the + <tt class="filename">/etc/group</tt>. A printer admin can do anything to + printers via the remote administration interfaces offered by MS-RPC + (see below). In larger installations, the <a class="indexterm" name="id2922440"></a><i class="parameter"><tt>printer admin</tt></i> + parameter is normally a per-share parameter. This permits different groups to administer each printer share. + </p></dd><dt><span class="term"><a class="indexterm" name="id2922460"></a><i class="parameter"><tt>lpq cache time</tt></i> = 20 </span></dt><dd><p>Controls the cache time for the results of the + lpq command. It prevents the lpq command being called too often and + reduces the load on a heavily used print server. + </p></dd><dt><span class="term"><a class="indexterm" name="id2922487"></a><i class="parameter"><tt>use client driver</tt></i> = no </span></dt><dd><p>If set to <tt class="constant">yes</tt>, only + takes effect for Windows NT/200x/XP clients (and not for Win 95/98/ME). Its + default value is <tt class="constant">No</tt> (or <tt class="constant">False</tt>). + It must <span class="emphasis"><em>not</em></span> be enabled on print shares + (with a <tt class="constant">yes</tt> or <tt class="constant">true</tt> setting) that + have valid drivers installed on the Samba server. For more detailed + explanations see the <tt class="filename">smb.conf</tt> man page. + </p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="ptrsect"></a>The [printers] Section</h4></div></div><div></div></div><p> +This is the second special section. If a section with this name appears in +the <tt class="filename">smb.conf</tt>, users are able to connect to any printer specified in the +Samba host's printcap file, because Samba on startup then creates a printer +share for every printername it finds in the printcap file. You could regard +this section as a general convenience shortcut to share all printers with +minimal configuration. It is also a container for settings that should +apply as default to all printers. (For more details see the <tt class="filename">smb.conf</tt> +man page.) Settings inside this container must be Share Level parameters. +</p><div class="variablelist"><dl><dt><span class="term"><a class="indexterm" name="id2922592"></a><i class="parameter"><tt>comment</tt></i> = All printers </span></dt><dd><p> + The <a class="indexterm" name="id2922612"></a><i class="parameter"><tt>comment</tt></i> is shown next to the share if + a client queries the server, either via <span class="guiicon">Network Neighborhood</span> or with + the <b class="command">net view</b> command to list available shares. + </p></dd><dt><span class="term"><a class="indexterm" name="id2922646"></a><i class="parameter"><tt>printable</tt></i> = yes </span></dt><dd><p> + The <i class="parameter"><tt>[printers]</tt></i> service <span class="emphasis"><em>must</em></span> + be declared as printable. If you specify otherwise, smbd will refuse to load at + startup. This parameter allows connected clients to open, write to and submit spool files + into the directory specified with the <a class="indexterm" name="id2922680"></a><i class="parameter"><tt>path</tt></i> + parameter for this service. It is used by Samba to differentiate printer shares from + file shares. + </p></dd><dt><span class="term"><a class="indexterm" name="id2922702"></a><i class="parameter"><tt>path</tt></i> = /var/spool/samba </span></dt><dd><p> + Must point to a directory used by Samba to spool incoming print files. <span class="emphasis"><em>It + must not be the same as the spool directory specified in the configuration of your UNIX + print subsystem!</em></span> The path typically points to a directory that is world + writeable, with the “<span class="quote">sticky</span>” bit set to it. + </p></dd><dt><span class="term"><a class="indexterm" name="id2922740"></a><i class="parameter"><tt>browseable</tt></i> = no </span></dt><dd><p> + Is always set to <tt class="constant">no</tt> if + <a class="indexterm" name="id2922764"></a><i class="parameter"><tt>printable</tt></i> = yes. It makes + the <i class="parameter"><tt>[printer]</tt></i> share itself invisible in the list of + available shares in a <b class="command">net view</b> command or in the Explorer browse + list. (You will of course see the individual printers). + </p></dd><dt><span class="term"><a class="indexterm" name="id2922800"></a><i class="parameter"><tt>guest ok</tt></i> = yes </span></dt><dd><p> + If this parameter is set to <tt class="constant">yes</tt>, no password is required to + connect to the printer's service. Access will be granted with the privileges of the + <a class="indexterm" name="id2922826"></a><i class="parameter"><tt>guest account</tt></i>. On many systems the guest + account will map to a user named “<span class="quote">nobody</span>”. This user will usually be found + in the UNIX passwd file with an empty password, but with no valid UNIX login. (On some + systems the guest account might not have the privilege to be able to print. Test this + by logging in as your guest user using <b class="command">su - guest</b> and run a system + print command like: + </p><p> + <b class="userinput"><tt>lpr -P printername /etc/motd</tt></b> + </p></dd><dt><span class="term"><a class="indexterm" name="id2922875"></a><i class="parameter"><tt>public</tt></i> = yes </span></dt><dd><p> + Is a synonym for <a class="indexterm" name="id2922894"></a><i class="parameter"><tt>guest ok</tt></i> = yes. + Since we have <a class="indexterm" name="id2922909"></a><i class="parameter"><tt>guest ok</tt></i> = yes, it + really does not need to be here. (This leads to the interesting question: “<span class="quote">What if I + by accident have two contradictory settings for the same share?</span>” The answer is the + last one encountered by Samba wins. Testparm does not complain about different settings + of the same parameter for the same share. You can test this by setting up multiple + lines for the <i class="parameter"><tt>guest account</tt></i> parameter with different usernames, + and then run testparm to see which one is actually used by Samba.) + </p></dd><dt><span class="term"><a class="indexterm" name="id2922947"></a><i class="parameter"><tt>read only</tt></i> = yes </span></dt><dd><p> + Normally (for other types of shares) prevents users from creating or modifying files + in the service's directory. However, in a “<span class="quote">printable</span>” service, it is + <span class="emphasis"><em>always</em></span> allowed to write to the directory (if user privileges allow the + connection), but only via print spooling operations. Normal write operations are not permitted. + </p></dd><dt><span class="term"><a class="indexterm" name="id2922986"></a><i class="parameter"><tt>writeable</tt></i> = no </span></dt><dd><p> + Is a synonym for <a class="indexterm" name="id2923006"></a><i class="parameter"><tt>read only</tt></i> = yes. + </p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2923024"></a>Any [my_printer_name] Section</h4></div></div><div></div></div><p> +If a section appears in the <tt class="filename">smb.conf</tt> file, which when given the parameter +<a class="indexterm" name="id2923042"></a><i class="parameter"><tt>printable</tt></i> = yes causes Samba to configure it +as a printer share. Windows 9x/Me clients may have problems with connecting or loading printer drivers +if the share name has more than eight characters. Do not name a printer share with a name that may conflict +with an existing user or file share name. On Client connection requests, Samba always tries to find file +shares with that name first. If it finds one, it will connect to this and will not connect +to a printer with the same name! +</p><div class="variablelist"><dl><dt><span class="term"><a class="indexterm" name="id2923073"></a><i class="parameter"><tt>comment</tt></i> = Printer with Restricted Access </span></dt><dd><p> + The comment says it all. + </p></dd><dt><span class="term"><a class="indexterm" name="id2923099"></a><i class="parameter"><tt>path</tt></i> = /var/spool/samba_my_printer </span></dt><dd><p> + Sets the spooling area for this printer to a directory other than the default. It is not + necessary to set it differently, but the option is available. + </p></dd><dt><span class="term"><a class="indexterm" name="id2923126"></a><i class="parameter"><tt>printer admin</tt></i> = kurt </span></dt><dd><p> + The printer admin definition is different for this explicitly defined printer share from the general + <i class="parameter"><tt>[printers]</tt></i> share. It is not a requirement; we + did it to show that it is possible. + </p></dd><dt><span class="term"><a class="indexterm" name="id2923161"></a><i class="parameter"><tt>browseable</tt></i> = yes </span></dt><dd><p> + This makes the printer browseable so the clients may conveniently find it when browsing the + <span class="guiicon">Network Neighborhood</span>. + </p></dd><dt><span class="term"><a class="indexterm" name="id2923196"></a><i class="parameter"><tt>printable</tt></i> = yes </span></dt><dd><p> + See <link linkend="ptrsect">. + </p></dd><dt><span class="term"><a class="indexterm" name="id2923228"></a><i class="parameter"><tt>writeable</tt></i> = no </span></dt><dd><p> + See <link linkend="ptrsect">. + </p></dd><dt><span class="term"><a class="indexterm" name="id2923260"></a><i class="parameter"><tt>hosts allow</tt></i> = 10.160.50.,10.160.51. </span></dt><dd><p> + Here we exercise a certain degree of access control by using the <a class="indexterm" name="id2923281"></a><i class="parameter"><tt>hosts allow</tt></i> and <a class="indexterm" name="id2923294"></a><i class="parameter"><tt>hosts deny</tt></i> + parameters. This is not by any means a safe bet. It is not a way to secure your + printers. This line accepts all clients from a certain subnet in a first evaluation of + access control. + </p></dd><dt><span class="term"><a class="indexterm" name="id2923317"></a><i class="parameter"><tt>hosts deny</tt></i> = turbo_xp,10.160.50.23,10.160.51.60 </span></dt><dd><p> + All listed hosts are not allowed here (even if they belong to the allowed subnets). As + you can see, you could name IP addresses as well as NetBIOS hostnames here. + </p></dd><dt><span class="term"><a class="indexterm" name="id2923345"></a><i class="parameter"><tt>guest ok</tt></i> = no </span></dt><dd><p> + This printer is not open for the guest account. + </p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2923371"></a>Print Commands</h4></div></div><div></div></div><p> +In each section defining a printer (or in the <i class="parameter"><tt>[printers]</tt></i> section), +a <i class="parameter"><tt>print command</tt></i> parameter may be defined. It sets a command to process the files +that have been placed into the Samba print spool directory for that printer. (That spool directory was, +if you remember, set up with the <a class="indexterm" name="id2923399"></a><i class="parameter"><tt>path</tt></i> parameter). Typically, +this command will submit the spool file to the Samba host's print subsystem, using the suitable system +print command. But there is no requirement that this needs to be the case. For debugging or +some other reason, you may want to do something completely different than print the file. An example is a +command that just copies the print file to a temporary location for further investigation when you need +to debug printing. If you craft your own print commands (or even develop print command shell scripts), +make sure you pay attention to the need to remove the files from the Samba spool directory. Otherwise, +your hard disk may soon suffer from shortage of free space. +</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2923428"></a>Default UNIX System Printing Commands</h4></div></div><div></div></div><p> +You learned earlier on that Samba, in most cases, uses its built-in settings for many parameters +if it cannot find an explicitly stated one in its configuration file. The same is true for the +<a class="indexterm" name="id2923441"></a><i class="parameter"><tt>print command</tt></i>. The default print command varies depending +on the <a class="indexterm" name="id2923458"></a><i class="parameter"><tt>printing</tt></i> parameter setting. In the commands listed +below, you will notice some parameters of the form <span class="emphasis"><em>%X</em></span> where <span class="emphasis"><em>X</em></span> is +<span class="emphasis"><em>p, s, J</em></span>, and so on. These letters stand for printer name, spoolfile and job ID, respectively. +They are explained in more detail further below. <link linkend="printOptions"> presents an overview of key +printing options but excludes the special case of CUPS that is discussed in <link linkend="CUPS-printing">. +</p><div class="table"><a name="printOptions"></a><p class="title"><b>Table 18.1. Default Printing Settings</b></p><table summary="Default Printing Settings" border="1"><colgroup><col align="left"><col align="left"></colgroup><thead><tr><th align="left">Setting</th><th align="left">Default Printing Commands</th></tr></thead><tbody><tr><td align="left"><a class="indexterm" name="id2923569"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">print command is <b class="command">lpr -r -P%p %s</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923599"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">print command is <b class="command">lp -c -P%p %s; rm %s</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923631"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">print command is <b class="command">lp -r -P%p -s %s</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923662"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">lpq command is <b class="command">lpq -P%p</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923692"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">lpq command is <b class="command">lpstat -o%p</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923723"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">lpq command is <b class="command">lpq -P%p</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923753"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">lprm command is <b class="command">lprm -P%p %j</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923784"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">lprm command is <b class="command">cancel %p-%j</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923814"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">lprm command is <b class="command">cancel %p-%j</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923845"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">lppause command is <b class="command">lp -i %p-%j -H hold</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923876"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">lppause command (...is empty)</td></tr><tr><td align="left"><a class="indexterm" name="id2923901"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">lppause command (...is empty)</td></tr><tr><td align="left"><a class="indexterm" name="id2923926"></a><i class="parameter"><tt>printing</tt></i> = bsd|aix|lprng|plp</td><td align="left">lpresume command is <b class="command">lp -i %p-%j -H resume</b></td></tr><tr><td align="left"><a class="indexterm" name="id2923957"></a><i class="parameter"><tt>printing</tt></i> = sysv|hpux</td><td align="left">lpresume command (...is empty)</td></tr><tr><td align="left"><a class="indexterm" name="id2923983"></a><i class="parameter"><tt>printing</tt></i> = qnx</td><td align="left">lpresume command (...is empty)</td></tr></tbody></table></div><p> +We excluded the special case of CUPS here, because it is discussed in the next chapter. For +<i class="parameter"><tt>printing = CUPS</tt></i>, if Samba is compiled against libcups, it uses the CUPS API to submit +jobs. (It is a good idea also to set <a class="indexterm" name="id2924021"></a><i class="parameter"><tt>printcap</tt></i> = cups +in case your <tt class="filename">cupsd.conf</tt> is set to write its autogenerated printcap file to an +unusual place). Otherwise, Samba maps to the System V printing commands with the -oraw option for printing, +i.e., it uses <b class="command">lp -c -d%p -oraw; rm %s</b>. With <i class="parameter"><tt>printing = cups</tt></i>, +and if Samba is compiled against libcups, any manually set print command will be ignored! +</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2924063"></a>Custom Print Commands</h4></div></div><div></div></div><p> +After a print job has finished spooling to a service, the <a class="indexterm" name="id2924074"></a><i class="parameter"><tt>print command</tt></i> + will be used by Samba via a <span class="emphasis"><em>system()</em></span> call to process the +spool file. Usually the command specified will submit the spool file to the host's printing subsystem. But +there is no requirement at all that this must be the case. The print subsystem may not remove the spool +file on its own. So whatever command you specify, you should ensure that the spool file is deleted after +it has been processed. </p><p> -There is no difficulty with using your own customized print commands -with the traditional printing systems. However, if you don't wish to -"roll your own", you should be well informed about the default -built-in commands that Samba uses for each printing subsystem (see the -table above). In all the commands listed in the last paragraphs you -see parameters of the form <span class="emphasis"><em>%X</em></span> These are -<span class="emphasis"><em>macros</em></span>, or shortcuts, used as place holders for -the names of real objects. At the time of running a command with such -a placeholder, Samba will insert the appropriate value -automatically. Print commands can handle all Samba macro -substitutions. In regard to printing, the following ones do have +There is no difficulty with using your own customized print commands with the traditional printing +systems. However, if you do not wish to roll your own, you should be well informed about the default +built-in commands that Samba uses for each printing subsystem (see +Table 17.1). In all the +commands listed in the last paragraphs, you see parameters of the form <span class="emphasis"><em>%X</em></span>. These are +<span class="emphasis"><em>macros</em></span>, or shortcuts, used as placeholders for the names of real objects. At the time +of running a command with such a placeholder, Samba will insert the appropriate value automatically. Print +commands can handle all Samba macro substitutions. In regard to printing, the following ones do have special relevance: -</p><div class="itemizedlist"><ul type="disc"><li><p><i class="parameter"><tt>%s, %f</tt></i> - the path to the spool -file name</p></li><li><p><i class="parameter"><tt>%p</tt></i> - the appropriate printer -name</p></li><li><p><i class="parameter"><tt>%J</tt></i> - the job name as -transmitted by the client.</p></li><li><p><i class="parameter"><tt>%c</tt></i> - the number of printed -pages of the spooled job (if known).</p></li><li><p><i class="parameter"><tt>%z</tt></i> - the size of the spooled -print job (in bytes)</p></li></ul></div><p> -The print command MUST contain at least one occurrence of -<i class="parameter"><tt>%s</tt></i> or <i class="parameter"><tt>%f</tt></i>. -- The -<i class="parameter"><tt>%p</tt></i> is optional. If no printer name is supplied, -the <i class="parameter"><tt>%p</tt></i> will be silently removed from the print -command. In this case the job is sent to the default printer. +</p><div class="itemizedlist"><ul type="disc"><li><p><i class="parameter"><tt>%s, %f</tt></i> the path to the spool file name.</p></li><li><p><i class="parameter"><tt>%p</tt></i> the appropriate printer name.</p></li><li><p><i class="parameter"><tt>%J</tt></i> the job name as transmitted by the client.</p></li><li><p><i class="parameter"><tt>%c</tt></i> the number of printed pages of the spooled job (if known).</p></li><li><p><i class="parameter"><tt>%z</tt></i> the size of the spooled print job (in bytes).</p></li></ul></div><p> +The print command must contain at least one occurrence of <i class="parameter"><tt>%s</tt></i> or +the <i class="parameter"><tt>%f</tt></i>. The <i class="parameter"><tt>%p</tt></i> is optional. If no printer name is supplied, +the <i class="parameter"><tt>%p</tt></i> will be silently removed from the print command. In this case, the job is +sent to the default printer. </p><p> -If specified in the <i class="parameter"><tt>[global]</tt></i> section, the print -command given will be used for any printable service that does not -have its own print command specified. If there is neither a specified -print command for a printable service nor a global print command, -spool files will be created but not processed! And (most importantly): -print files will not be removed, so they will start filling your Samba -hard disk. +If specified in the <i class="parameter"><tt>[global]</tt></i> section, the print command given will be +used for any printable service that does not have its own print command specified. If there is neither a +specified print command for a printable service nor a global print command, spool files will be created +but not processed! Most importantly, print files will not be removed, so they will consume disk space. </p><p> -Note that printing may fail on some UNIXes from the "nobody" -account. If this happens, create an alternative guest account and -supply it with the privilege to print. Set up this guest account in -the <i class="parameter"><tt>[global]</tt></i> section with the <i class="parameter"><tt>guest -account</tt></i> parameter. +Printing may fail on some UNIX systems when using the “<span class="quote">nobody</span>” account. If this happens, create an +alternative guest account and give it the privilege to print. Set up this guest account in the +<i class="parameter"><tt>[global]</tt></i> section with the <i class="parameter"><tt>guest account</tt></i> parameter. </p><p> -You can form quite complex print commands. You need to realize that -print commands are just passed to a UNIX shell. The shell is able to -expand the included environment variables as usual. (The syntax to -include a UNIX environment variable <i class="parameter"><tt>$variable</tt></i> -in or in the Samba print command is -<i class="parameter"><tt>%$variable</tt></i>.) To give you a working -<a class="indexterm" name="id2917032"></a><i class="parameter"><tt>print command</tt></i> example, the following will log a -print job to <tt class="filename">/tmp/print.log</tt>, print the file, then -remove it. Note that ';' is the usual separator for commands in shell -scripts: +You can form quite complex print commands. You need to realize that print commands are just +passed to a UNIX shell. The shell is able to expand the included environment variables as +usual. (The syntax to include a UNIX environment variable <i class="parameter"><tt>$variable</tt></i> +in the Samba print command is <i class="parameter"><tt>%$variable</tt></i>.) To give you a working +<a class="indexterm" name="id2924309"></a><i class="parameter"><tt>print command</tt></i> example, the following will log a print job +to <tt class="filename">/tmp/print.log</tt>, print the file, then remove it. The semicolon (“<span class="quote">;</span>” +is the usual separator for commands in shell scripts: </p><table class="simplelist" border="0" summary="Simple list"><tr><td><i class="parameter"><tt>print command = echo Printing %s >> /tmp/print.log; lpr -P %p %s; rm %s</tt></i></td></tr></table><p> -You may have to vary your own command considerably from this example -depending on how you normally print files on your system. The default -for the <a class="indexterm" name="id2917081"></a><i class="parameter"><tt>print command</tt></i> parameter varies depending on the setting of -the <a class="indexterm" name="id2917098"></a><i class="parameter"><tt>printing</tt></i> parameter. Another example is: -</p><table class="simplelist" border="0" summary="Simple list"><tr><td><i class="parameter"><tt>print command = /usr/local/samba/bin/myprintscript %p %s</tt></i></td></tr></table></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2917131"></a>Innovations in Samba Printing since 2.2</h2></div></div><div></div></div><p> -Before version 2.2.0, Samba's print server support for Windows clients -was limited to the level of <span class="emphasis"><em>LanMan</em></span> printing -calls. This is the same protocol level as Windows 9x PCs offer when -they share printers. Beginning with the 2.2.0 release, Samba started -to support the native Windows NT printing mechanisms. These are -implemented via <span class="emphasis"><em>MS-RPC</em></span> (RPC = <span class="emphasis"><em>Remote -Procedure Calls</em></span> ). MS-RPCs use the -<span class="emphasis"><em>SPOOLSS</em></span> named pipe for all printing. +You may have to vary your own command considerably from this example depending on how you normally print +files on your system. The default for the <a class="indexterm" name="id2924363"></a><i class="parameter"><tt>print command</tt></i> +parameter varies depending on the setting of the <a class="indexterm" name="id2924379"></a><i class="parameter"><tt>printing</tt></i> +parameter. Another example is: +</p><table class="simplelist" border="0" summary="Simple list"><tr><td><i class="parameter"><tt>print command = /usr/local/samba/bin/myprintscript %p %s</tt></i></td></tr></table></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2924414"></a>Printing Developments Since Samba-2.2</h2></div></div><div></div></div><p> +Prior to Samba-2.2.x, print server support for Windows clients was limited to <span class="emphasis"><em>LanMan</em></span> +printing calls. This is the same protocol level as Windows 9x/Me PCs offer when they share printers. +Beginning with the 2.2.0 release, Samba started to support the native Windows NT printing mechanisms. These +are implemented via <span class="emphasis"><em>MS-RPC</em></span> (RPC = <span class="emphasis"><em>Remote Procedure Calls</em></span> +). MS-RPCs use the <span class="emphasis"><em>SPOOLSS</em></span> named pipe for all printing. </p><p> The additional functionality provided by the new SPOOLSS support includes: -</p><div class="itemizedlist"><ul type="disc"><li><p>Support for downloading printer driver files to Windows -95/98/NT/2000 clients upon demand (<span class="emphasis"><em>Point'n'Print</em></span>); -</p></li><li><p>Uploading of printer drivers via the Windows NT -<span class="emphasis"><em>Add Printer Wizard</em></span> (APW) or the -<a href="http://imprints.sourceforge.net/" target="_top">Imprints</a> tool set. -</p></li><li><p>Support for the native MS-RPC printing calls such as - StartDocPrinter, EnumJobs(), etc... (See the <a href="http://msdn.microsoft.com/" target="_top">MSDN documentation</a> for more information on the Win32 printing API);</p></li><li><p>Support for NT <span class="emphasis"><em>Access Control -Lists</em></span> (ACL) on printer objects;</p></li><li><p>Improved support for printer queue manipulation -through the use of internal databases for spooled job information -(implemented by various <tt class="filename">*.tdb</tt> -files).</p></li></ul></div><p> -One other benefit of an update is this: Samba 3 is able to publish -all its printers in Active Directory (or LDAP)! +</p><div class="itemizedlist"><ul type="disc"><li><p> + Support for downloading printer driver files to Windows 95/98/NT/2000 clients upon + demand (<span class="emphasis"><em>Point'n'Print</em></span>). + </p></li><li><p> + Uploading of printer drivers via the Windows NT <span class="emphasis"><em>Add Printer Wizard</em></span> (APW) + or the <ulink url="http://imprints.sourceforge.net/">Imprints</ulink> tool set. + </p></li><li><p> + Support for the native MS-RPC printing calls such as + StartDocPrinter, EnumJobs(), and so on. (See the + <ulink url="http://msdn.microsoft.com/">MSDN documentation</ulink> for more information on the + Win32 printing API). + </p></li><li><p> + Support for NT <span class="emphasis"><em>Access Control Lists</em></span> (ACL) on printer objects. + </p></li><li><p> + Improved support for printer queue manipulation through the use of internal databases for spooled + job information (implemented by various <tt class="filename">*.tdb</tt> files). + </p></li></ul></div><p> +A benefit of updating is that Samba-3 is able to publish its printers to Active Directory (or LDAP). +</p><p> +A fundamental difference exists between MS Windows NT print servers and Samba operation. Windows NT +permits the installation of local printers that are not shared. This is an artifact of the fact that +any Windows NT machine (server or client) may be used by a user as a workstation. Samba will publish all +printers that are made available, either by default or by specific declaration via printer-specific shares. </p><p> -One slight difference is here: it is possible on a Windows NT print -server to have printers listed in the Printers folder which are -<span class="emphasis"><em>not</em></span> shared. Samba does not make this -distinction. By definition, the only printers of which Samba is aware -are those which are specified as shares in -. The reason is that Windows NT/200x/XP Professional -clients do not normally need to use the standard SMB printer share; -rather they can print directly to any printer on another Windows NT -host using MS-RPC. This of course assumes that the printing client has -the necessary privileges on the remote host serving the printer. The -default permissions assigned by Windows NT to a printer gives the -"Print" permissions to the well-known <span class="emphasis"><em>Everyone</em></span> -group. (The older clients of type Win9x can only print to "shared" +Windows NT/200x/XP Professional clients do not have to use the standard SMB printer share; they can +print directly to any printer on another Windows NT host using MS-RPC. This, of course, assumes that +the client has the necessary privileges on the remote host that serves the printer resource. The +default permissions assigned by Windows NT to a printer gives the Print permissions to the well-known +<span class="emphasis"><em>Everyone</em></span> group. (The older clients of type Windows 9x/Me can only print to shared printers). -</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2917292"></a>Client Drivers on Samba Server for <span class="emphasis"><em>Point'n'Print</em></span></h3></div></div><div></div></div><p> -There is still confusion about what all this means: <span class="emphasis"><em>Is it or -is it not a requirement for printer drivers to be installed on a Samba -host in order to support printing from Windows clients?</em></span> The -answer to this is: No, it is not a -<span class="emphasis"><em>requirement</em></span>. Windows NT/2000 clients can, of -course, also run their APW to install drivers -<span class="emphasis"><em>locally</em></span> (which then connect to a Samba served -print queue). This is the same method as used by Windows 9x -clients. (However, a <span class="emphasis"><em>bug</em></span> existed in Samba 2.2.0 -which made Windows NT/2000 clients require that the Samba server -possess a valid driver for the printer. This was fixed in Samba -2.2.1). +</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2924566"></a>Point'n'Print Client Drivers on Samba Servers</h3></div></div><div></div></div><p> +There is much confusion about what all this means. The question is often asked, “<span class="quote">Is it or is +it not necessary for printer drivers to be installed on a Samba host in order to support printing from +Windows clients?</span>” The answer to this is no, it is not necessary. +</p><p> +Windows NT/2000 clients can, of course, also run their APW to install drivers <span class="emphasis"><em>locally</em></span> +(which then connect to a Samba-served print queue). This is the same method used by Windows 9x/Me +clients. (However, a <span class="emphasis"><em>bug</em></span> existed in Samba 2.2.0 that made Windows NT/2000 clients +require that the Samba server possess a valid driver for the printer. This was fixed in Samba 2.2.1). +</p><p> +But it is a new capability to install the printer drivers into the <i class="parameter"><tt>[print$]</tt></i> +share of the Samba server, and a big convenience, too. Then <span class="emphasis"><em>all</em></span> clients +(including 95/98/ME) get the driver installed when they first connect to this printer share. The +<span class="emphasis"><em>uploading</em></span> or <span class="emphasis"><em>depositing</em></span> of the driver into this +<i class="parameter"><tt>[print$]</tt></i> share and the following binding of this driver to an existing +Samba printer share can be achieved by different means: +</p><div class="itemizedlist"><ul type="disc"><li><p> + Running the <span class="emphasis"><em>APW</em></span> on an NT/200x/XP Professional client (this does not work from 95/98/ME clients). + </p></li><li><p> + Using the <span class="emphasis"><em>Imprints</em></span> toolset. + </p></li><li><p> + Using the <span class="emphasis"><em>smbclient</em></span> and <span class="emphasis"><em>rpcclient</em></span> commandline tools. + </p></li><li><p> + Using <span class="emphasis"><em>cupsaddsmb</em></span> (only works for the CUPS + printing system, not for LPR/LPD, LPRng, and so on). + </p></li></ul></div><p> +Samba does not use these uploaded drivers in any way to process spooled files. These drivers are utilized +entirely by the clients who download and install them via the “<span class="quote">Point'n'Print</span>” mechanism +supported by Samba. The clients use these drivers to generate print files in the format the printer +(or the UNIX print system) requires. Print files received by Samba are handed over to the UNIX printing +system, which is responsible for all further processing, as needed. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2924710"></a>The Obsoleted [printer$] Section</h3></div></div><div></div></div><p> + Versions of Samba prior to 2.2 made it possible to use a share named + <i class="parameter"><tt>[printer$]</tt></i>. This name was taken from the same named service created by + Windows 9x/Me clients when a printer was shared by them. Windows 9x/Me printer servers always + have a <i class="parameter"><tt>[printer$]</tt></i> service that provides read-only access (with + no password required) to support printer driver downloads. However, Samba's initial + implementation allowed for a parameter named <i class="parameter"><tt>printer driver location</tt></i> to + be used on a per share basis. This specified the location of the driver files associated with + that printer. Another parameter named <i class="parameter"><tt>printer driver</tt></i> provided a means of + defining the printer driver name to be sent to the client. + </p><p> + These parameters, including the <i class="parameter"><tt>printer driver file</tt></i> parameter, + are now removed and cannot be used in installations of Samba-3. The share name + <i class="parameter"><tt>[print$]</tt></i> is now used for the location of downloadable printer + drivers. It is taken from the <i class="parameter"><tt>[print$]</tt></i> service created + by Windows NT PCs when a printer is shared by them. Windows NT print servers always have a + <i class="parameter"><tt>[print$]</tt></i> service that provides read-write access (in the context + of its ACLs) to support printer driver downloads and uploads. This does not mean Windows + 9x/Me clients are now thrown aside. They can use Samba's <i class="parameter"><tt>[print$]</tt></i> + share support just fine. + </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2924810"></a>Creating the [print$] Share</h3></div></div><div></div></div><p> +In order to support the uploading and downloading of printer driver files, you must first configure a +file share named <i class="parameter"><tt>[print$]</tt></i>. The public name of this share is hard coded +in the MS Windows clients. It cannot be renamed since Windows clients are programmed to search for a +service of exactly this name if they want to retrieve printer driver files. +</p><p> +You should modify the server's file to add the global parameters and create the +<i class="parameter"><tt>[print$]</tt></i> file share (of course, some of the parameter values, such +as <a class="indexterm" name="id2924847"></a><i class="parameter"><tt>path</tt></i> are arbitrary and should be replaced with appropriate values for your +site). See <link linkend="prtdollar">. </p><p> -But it is a new <span class="emphasis"><em>option</em></span> to install the printer -drivers into the <i class="parameter"><tt>[print$]</tt></i> share of the Samba -server, and a big convenience too. Then <span class="emphasis"><em>all</em></span> -clients (including 95/98/ME) get the driver installed when they first -connect to this printer share. The <span class="emphasis"><em>uploading</em></span> or -<span class="emphasis"><em>depositing</em></span> of the driver into this -<i class="parameter"><tt>[print$]</tt></i> share, and the following binding of -this driver to an existing Samba printer share can be achieved by -different means: -</p><div class="itemizedlist"><ul type="disc"><li><p>running the <span class="emphasis"><em>APW</em></span> on an -NT/200x/XP Professional client (this doesn't work from 95/98/ME -clients);</p></li><li><p>using the <span class="emphasis"><em>Imprints</em></span> -toolset;</p></li><li><p>using the <span class="emphasis"><em>smbclient</em></span> and -<span class="emphasis"><em>rpcclient</em></span> commandline tools;</p></li><li><p>using <span class="emphasis"><em>cupsaddsmb</em></span>(only works for -the CUPS printing system, not for LPR/LPD, LPRng -etc.).</p></li></ul></div><p> -Please take additional note of the following fact: <span class="emphasis"><em>Samba -does not use these uploaded drivers in any way to process spooled -files</em></span>. Drivers are utilized entirely by the clients, who -download and install them via the "Point'n'Print" mechanism supported -by Samba. The clients use these drivers to generate print files in the -format the printer (or the UNIX print system) requires. Print files -received by Samba are handed over to the UNIX printing system, which -is responsible for all further processing, if needed. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2917453"></a>The [printer$] Section is removed from Samba 3</h3></div></div><div></div></div><p><b> -<i class="parameter"><tt>[print$]</tt></i> vs. <i class="parameter"><tt>[printer$]</tt></i> -. </b> -Versions of Samba prior to 2.2 made it possible to use a share -named <span class="emphasis"><em>[printer$]</em></span>. This name was taken from the -same named service created by Windows 9x clients when a printer was -shared by them. Windows 9x printer servers always have a -<i class="parameter"><tt>[printer$]</tt></i> service which provides read-only -access (with no password required) in order to support printer driver -downloads. However, Samba's initial implementation allowed for a -parameter named <i class="parameter"><tt>printer driver location</tt></i> to be -used on a per share basis. This specified the location of the driver -files associated with that printer. Another parameter named -<i class="parameter"><tt>printer driver</tt></i> provided a means of defining the -printer driver name to be sent to the client. These parameters, -including the <i class="parameter"><tt>printer driver file</tt></i> parameter, -are now removed and can not be used in installations of samba-3. -Now the share name <i class="parameter"><tt>[print$]</tt></i> is used for the -location of downloadable printer drivers. It is taken from the -<i class="parameter"><tt>[print$]</tt></i> service created by Windows NT PCs when -a printer is shared by them. Windows NT print servers always have a -<i class="parameter"><tt>[print$]</tt></i> service which provides read-write -access (in the context of its ACLs) in order to support printer driver -down- and uploads. Don't fear -- this does not mean Windows 9x -clients are thrown aside now. They can use Samba's -<i class="parameter"><tt>[print$]</tt></i> share support just fine. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2917566"></a>Creating the [print$] Share</h3></div></div><div></div></div><p> -In order to support the up- and downloading of printer driver files, -you must first configure a file share named -<i class="parameter"><tt>[print$]</tt></i>. The "public" name of this share is -hard coded in Samba's internals (because it is hard coded in the MS -Windows clients too). It cannot be renamed since Windows clients are -programmed to search for a service of exactly this name if they want -to retrieve printer driver files. +</p><div class="example"><a name="prtdollar"></a><p class="title"><b>Example 18.3. [print\$] example</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td># members of the ntadmin group should be able to add drivers and set</td></tr><tr><td># printer properties. root is implicitly always a 'printer admin'.</td></tr><tr><td><i class="parameter"><tt>printer admin = @ntadmin</tt></i></td></tr><tr><td>...</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td>...</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[print$]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = Printer Driver Download Area</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /etc/samba/drivers</tt></i></td></tr><tr><td><i class="parameter"><tt>browseable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>read only = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>write list = @ntadmin, root</tt></i></td></tr></table></div><p> </p><p> -You should modify the server's file to -add the global parameters and create the -<i class="parameter"><tt>[print$]</tt></i> file share (of course, some of the -parameter values, such as 'path' are arbitrary and should be replaced -with appropriate values for your site): -</p><div class="example"><a name="id2917613"></a><p class="title"><b>Example 18.3. [print\$] example</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td># members of the ntadmin group should be able to add drivers and set</td></tr><tr><td># printer properties. root is implicitly always a 'printer admin'.</td></tr><tr><td><i class="parameter"><tt>printer admin = @ntadmin</tt></i></td></tr><tr><td>...</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td>...</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[print$]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = Printer Driver Download Area</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /etc/samba/drivers</tt></i></td></tr><tr><td><i class="parameter"><tt>browseable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>read only = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>write list = @ntadmin, root</tt></i></td></tr></table></div><p> Of course, you also need to ensure that the directory named by the -<a class="indexterm" name="id2917739"></a><i class="parameter"><tt>path</tt></i> parameter exists on the UNIX file system. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2917756"></a>Parameters in the [print$] Section</h3></div></div><div></div></div><p> -<i class="parameter"><tt>[print$]</tt></i> is a special section in -. It contains settings relevant to -potential printer driver download and local installation by clients. -</p><div class="variablelist"><dl><dt><span class="term"><a class="indexterm" name="id2917784"></a><i class="parameter"><tt>comment</tt></i> = Printer Driver - Download Area</span></dt><dd><p> the comment appears next to the share name if it is -listed in a share list (usually Windows clients won't see it often but -it will also appear up in a <b class="command">smbclient -L sambaserver -</b> output). </p></dd><dt><span class="term"><a class="indexterm" name="id2917819"></a><i class="parameter"><tt>path</tt></i> = /etc/samba/printers</span></dt><dd><p> this is the path to the location of the Windows -driver file deposit from the UNIX point of -view.</p></dd><dt><span class="term"><a class="indexterm" name="id2917844"></a><i class="parameter"><tt>browseable</tt></i> = no</span></dt><dd><p> this makes the <i class="parameter"><tt>[print$]</tt></i> share -"invisible" in Network Neighbourhood to clients. However, you can -still "mount" it from any client using the <b class="command">net use -g:\\sambaserver\print$</b> command in a "DOS box" or the -"Connect network drive" menu from Windows -Explorer.</p></dd><dt><span class="term"><a class="indexterm" name="id2917889"></a><i class="parameter"><tt>guest ok</tt></i> = yes</span></dt><dd><p>this gives read only access to this share for all -guest users. Access may be used to download and install printer -drivers on clients. The requirement for <i class="parameter"><tt>guest ok = -yes</tt></i> depends upon how your site is configured. If users -will be guaranteed to have an account on the Samba host, then this is -a non-issue.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> -The non-issue is this: if all your Windows NT users are guaranteed to -be authenticated by the Samba server (for example if Samba -authenticates via an NT domain server and the NT user has already been -validated by the Domain Controller in order to logon to the Windows NT -session), then guest access is not necessary. Of course, in a -workgroup environment where you just want to be able to print without -worrying about silly accounts and security, then configure the share -for guest access. You'll probably want to add <a class="indexterm" name="id2917936"></a><i class="parameter"><tt>map to guest</tt></i> = Bad User in the -<i class="parameter"><tt>[global]</tt></i> section -as well. Make sure you understand what this parameter does before -using it. -</p></div></dd><dt><span class="term"><a class="indexterm" name="id2917963"></a><i class="parameter"><tt>read only</tt></i> = yes</span></dt><dd><p>as we don't want everybody to upload driver files (or -even change driver settings) we tagged this share as not -writeable.</p></dd><dt><span class="term"><a class="indexterm" name="id2917990"></a><i class="parameter"><tt>write list</tt></i> = @ntadmin,root</span></dt><dd><p>since the <i class="parameter"><tt>[print$]</tt></i> was made -read only by the previous setting, we need to create a "write list" -also. UNIX groups (denoted with a leading "@" character) and users -listed here are allowed write access (as an exception to the general -public's "read-only" access), which they need to update files on the -share. Normally you will want to only name administrative level user -accounts in this setting. Check the file system permissions to make -sure these accounts can copy files to the share. If this is a non-root -account, then the account should also be mentioned in the global -<a class="indexterm" name="id2918045"></a><i class="parameter"><tt>printer admin </tt></i> parameter. See the - man page for more information on -configuring file shares. </p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2918066"></a>Subdirectory Structure in [print$]</h3></div></div><div></div></div><p> -In order for a Windows NT print server to support the downloading of -driver files by multiple client architectures, you must create several -subdirectories within the <i class="parameter"><tt>[print$]</tt></i> service -(i.e. the UNIX directory named by the <a class="indexterm" name="id2918085"></a><i class="parameter"><tt>path</tt></i> -parameter). These correspond to each of the supported client -architectures. Samba follows this model as well. Just like the name of -the <i class="parameter"><tt>[print$]</tt></i> share itself, the subdirectories -*must* be exactly the names listed below (you may leave out the -subdirectories of architectures you don't want to support). +<a class="indexterm" name="id2925004"></a><i class="parameter"><tt>path</tt></i> parameter exists on the UNIX file system. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2925021"></a>[print$] Section Parameters</h3></div></div><div></div></div><p> +The <i class="parameter"><tt>[print$]</tt></i> is a special section in <tt class="filename">smb.conf</tt>. It contains settings relevant to +potential printer driver download and is used by windows clients for local print driver installation. +The following parameters are frequently needed in this share section: +</p><div class="variablelist"><dl><dt><span class="term"><a class="indexterm" name="id2925058"></a><i class="parameter"><tt>comment</tt></i> = Printer Driver Download Area </span></dt><dd><p> + The comment appears next to the share name if it is listed in a share list (usually Windows + clients will not see it, but it will also appear up in a <b class="command">smbclient -L sambaserver + </b> output). + </p></dd><dt><span class="term"><a class="indexterm" name="id2925094"></a><i class="parameter"><tt>path</tt></i> = /etc/samba/printers </span></dt><dd><p> + Is the path to the location of the Windows driver file deposit from the UNIX point of view. + </p></dd><dt><span class="term"><a class="indexterm" name="id2925120"></a><i class="parameter"><tt>browseable</tt></i> = no </span></dt><dd><p> + Makes the <i class="parameter"><tt>[print$]</tt></i> share invisible to clients from the + <span class="guimenu">Network Neighborhood</span>. However, you can still mount it from any client + using the <b class="command">net use g:\\sambaserver\print$</b> command in a DOS-box or the + <span class="guimenu">Connect network drive menu></span> from Windows Explorer. + </p></dd><dt><span class="term"><a class="indexterm" name="id2925177"></a><i class="parameter"><tt>guest ok</tt></i> = yes </span></dt><dd><p> + Gives read-only access to this share for all guest users. Access may be granted to + download and install printer drivers on clients. The requirement for <i class="parameter"><tt>guest ok + = yes</tt></i> depends on how your site is configured. If users will be guaranteed + to have an account on the Samba host, then this is a non-issue. + </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + If all your Windows NT users are guaranteed to be authenticated by the Samba server + (for example, if Samba authenticates via an NT domain server and the user has already been + validated by the Domain Controller in order to logon to the Windows NT session), then guest + access is not necessary. Of course, in a workgroup environment where you just want + to print without worrying about silly accounts and security, then configure the share for + guest access. You should consider adding <a class="indexterm" name="id2925224"></a><i class="parameter"><tt>map to guest</tt></i> = Bad + User in the <i class="parameter"><tt>[global]</tt></i> section + as well. Make sure you understand what this parameter does before using it. + </p></div></dd><dt><span class="term"><a class="indexterm" name="id2925252"></a><i class="parameter"><tt>read only</tt></i> = yes </span></dt><dd><p> + Because we do not want everybody to upload driver files (or even change driver settings), + we tagged this share as not writeable. + </p></dd><dt><span class="term"><a class="indexterm" name="id2925280"></a><i class="parameter"><tt>write list</tt></i> = @ntadmin, root </span></dt><dd><p> + The <i class="parameter"><tt>[print$]</tt></i> was made read-only by the previous + setting so we should create a <i class="parameter"><tt>write list</tt></i> entry also. UNIX + groups (denoted with a leading “<span class="quote">@</span>” character). Users listed here are allowed + write-access (as an exception to the general public's read-only access), which they need to + update files on the share. Normally, you will want to only name administrative-level user + account in this setting. Check the file system permissions to make sure these accounts + can copy files to the share. If this is a non-root account, then the account should also + be mentioned in the global <a class="indexterm" name="id2925328"></a><i class="parameter"><tt>printer admin</tt></i> + parameter. See the <tt class="filename">smb.conf</tt> man page for more information on configuring file shares. + </p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2925355"></a>The [print$] Share Directory</h3></div></div><div></div></div><p> +In order for a Windows NT print server to support the downloading of driver files by multiple client +architectures, you must create several subdirectories within the <i class="parameter"><tt>[print$]</tt></i> +service (i.e., the UNIX directory named by the <a class="indexterm" name="id2925375"></a><i class="parameter"><tt>path</tt></i> +parameter). These correspond to each of the supported client architectures. Samba follows this model as +well. Just like the name of the <i class="parameter"><tt>[print$]</tt></i> share itself, the subdirectories +must be exactly the names listed below (you may leave out the subdirectories of architectures you do +not need to support). </p><p> Therefore, create a directory tree below the <i class="parameter"><tt>[print$]</tt></i> share for each architecture you wish -to support. +to support like this: </p><pre class="programlisting"> -[print$]--+-- - |--W32X86 # serves drivers to "Windows NT x86" - |--WIN40 # serves drivers to "Windows 95/98" - |--W32ALPHA # serves drivers to "Windows NT Alpha_AXP" - |--W32MIPS # serves drivers to "Windows NT R4000" - |--W32PPC # serves drivers to "Windows NT PowerPC" -</pre><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Required permissions</h3><p> -In order to add a new driver to your Samba host, one of two conditions -must hold true: -</p><div class="itemizedlist"><ul type="disc"><li><p>The account used to connect to the Samba host must -have a UID of 0 (i.e. a root account)</p></li><li><p>The account used to connect to the Samba host must be -named in the <span class="emphasis"><em>printer admin</em></span>list.</p></li></ul></div><p> -Of course, the connected account must still possess access to add -files to the subdirectories beneath -<i class="parameter"><tt>[print$]</tt></i>. Remember that all file shares are set -to 'read only' by default. -</p></div><p> -Once you have created the required <i class="parameter"><tt>[print$]</tt></i> -service and associated subdirectories, go to a Windows NT 4.0/2k/XP -client workstation. Open <span class="guiicon">Network Neighbourhood</span> or -<span class="guiicon">My Network Places</span> and browse for the Samba host. -Once you have located the server, navigate to its <span class="guiicon">Printers and -Faxes</span> folder. You should see an initial listing of printers -that matches the printer shares defined on your Samba host. -</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2918239"></a>Installing Drivers into [print$]</h2></div></div><div></div></div><p> -You have successfully created the <i class="parameter"><tt>[print$]</tt></i> -share in ? And Samba has re-read its -configuration? Good. But you are not yet ready to take off. The -<span class="emphasis"><em>driver files</em></span> need to be present in this share, -too! So far it is still an empty share. Unfortunately, it is not enough -to just copy the driver files over. They need to be <span class="emphasis"><em>set -up</em></span> too. And that is a bit tricky, to say the least. We -will now discuss two alternative ways to install the drivers into -<i class="parameter"><tt>[print$]</tt></i>: -</p><div class="itemizedlist"><ul type="disc"><li><p>using the Samba commandline utility -<b class="command">rpcclient</b> with its various subcommands (here: -<b class="command">adddriver</b> and <b class="command">setdriver</b>) from -any UNIX workstation;</p></li><li><p>running a GUI (<span class="emphasis"><em>Printer -Properties</em></span> and <span class="emphasis"><em>Add Printer Wizard</em></span>) -from any Windows NT/2k/XP client workstation.</p></li></ul></div><p> -The latter option is probably the easier one (even if the only -entrance to this realm seems a little bit weird at first). -</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2918333"></a>Setting Drivers for existing Printers with a Client GUI</h3></div></div><div></div></div><p> -The initial listing of printers in the Samba host's -<span class="guiicon">Printers</span> folder accessed from a client's Explorer -will have no real printer driver assigned to them. By default -this driver name is set to a NULL -string. This must be changed now. The local <span class="emphasis"><em>Add Printer -Wizard</em></span>, run from NT/2000/XP clients, will help us in this -task. +[print$]--+ + |--W32X86 # serves drivers to Windows NT x86 + |--WIN40 # serves drivers to Windows 95/98 + |--W32ALPHA # serves drivers to Windows NT Alpha_AXP + |--W32MIPS # serves drivers to Windows NT R4000 + |--W32PPC # serves drivers to Windows NT PowerPC +</pre><p> +</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Required permissions</h3><p> + In order to add a new driver to your Samba host, one of two conditions must hold true: + </p><div class="itemizedlist"><ul type="disc"><li><p> + The account used to connect to the Samba host must have a UID of 0 (i.e., a root account). + </p></li><li><p> + The account used to connect to the Samba host must be named in the <span class="emphasis"><em>printer admin</em></span>list. + </p></li></ul></div><p> + Of course, the connected account must still have write access to add files to the subdirectories beneath + <i class="parameter"><tt>[print$]</tt></i>. Remember that all file shares are set to “<span class="quote">read-only</span>” by default. + </p></div><p> +Once you have created the required <i class="parameter"><tt>[print$]</tt></i> service and +associated subdirectories, go to a Windows NT 4.0/200x/XP client workstation. Open <span class="guiicon">Network +Neighborhood</span> or <span class="guiicon">My Network Places</span> and browse for the Samba host. Once you +have located the server, navigate to its <span class="guiicon">Printers and Faxes</span> folder. You should see +an initial listing of printers that matches the printer shares defined on your Samba host. +</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2925525"></a>Installing Drivers into [print$]</h2></div></div><div></div></div><p> +Have you successfully created the <i class="parameter"><tt>[print$]</tt></i> share in <tt class="filename">smb.conf</tt>, and have your forced Samba +to re-read its <tt class="filename">smb.conf</tt> file? Good. But you are not yet ready to use the new facility. The client driver +files need to be installed into this share. So far it is still an empty share. Unfortunately, it is +not enough to just copy the driver files over. They need to be +correctly installed so that appropriate +records for each driver will exist in the Samba internal databases so it can provide the correct +drivers as they are requested from MS Windows clients. And that is a bit tricky, to say the least. We +now discuss two alternative ways to install the drivers into <i class="parameter"><tt>[print$]</tt></i>: +</p><div class="itemizedlist"><ul type="disc"><li><p> + Using the Samba commandline utility <b class="command">rpcclient</b> with its various subcommands (here: + <b class="command">adddriver</b> and <b class="command">setdriver</b>) from any UNIX workstation. + </p></li><li><p> + Running a GUI (<span class="guiicon">Printer Properties</span> and <span class="guiicon">Add Printer Wizard</span>) + from any Windows NT/200x/XP client workstation. + </p></li></ul></div><p> +The latter option is probably the easier one (even if the process may seem a little bit weird at first). +</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2925644"></a>Add Printer Wizard Driver Installation</h3></div></div><div></div></div><p> +The initial listing of printers in the Samba host's <span class="guiicon">Printers</span> folder accessed from a +client's Explorer will have no real printer driver assigned to them. By default this driver name is set +to a null string. This must be changed now. The local <span class="guiicon">Add Printer Wizard</span> (APW), run from +NT/2000/XP clients, will help us in this task. </p><p> -However, the job to set a valid driver for the printer is not a -straightforward one: You must attempt to view the printer properties -for the printer to which you want the driver assigned. Open the -Windows Explorer, open Network Neighbourhood, browse to the Samba -host, open Samba's <span class="guiicon">Printers</span> folder, right-click the printer icon and -select <span class="guimenu">Properties...</span>. You are now trying to view printer and driver -properties for a queue which has this default <tt class="constant">NULL</tt> driver -assigned. This will result in an error message (this is normal here): -</p><p><span class="errorname"> Device settings cannot be displayed. The driver -for the specified printer is not installed, only spooler properties -will be displayed. Do you want to install the driver -now?</span></p><p> -<span class="emphasis"><em>Important:</em></span>Don't click <span class="guibutton">Yes</span>! Instead, -<span class="emphasis"><em>click <span class="guibutton">No</span></em></span> in the error dialog. -Only now you will be presented with the printer properties window. From here, -the way to assign a driver to a printer is open to us. You have now the choice -either: -</p><div class="itemizedlist"><ul type="disc"><li><p>select a driver from the pop-up list of installed -drivers. <span class="emphasis"><em>Initially this list will be empty.</em></span> -Or</p></li><li><p>use the <span class="guibutton">New Driver...</span> button to -install a new printer driver (which will in fact start up the -APW).</p></li></ul></div><p> -Once the APW is started, the procedure is exactly the same as the one -you are familiar with in Windows (we assume here that you are -familiar with the printer driver installations procedure on Windows -NT). Make sure your connection is in fact setup as a user with -<a class="indexterm" name="id2918468"></a><i class="parameter"><tt>printer admin</tt></i> privileges (if in doubt, use -<b class="command">smbstatus</b> to check for this). If you wish to -install printer drivers for client operating systems other than -<span class="application">Windows NT x86</span>, you will need to use the -<span class="guilabel">Sharing</span> tab of the printer properties dialog. +Installation of a valid printer driver is not straightforward. You must attempt +to view the printer properties for the printer to which you want the driver assigned. Open the Windows +Explorer, open <span class="guiicon">Network Neighborhood</span>, browse to the Samba host, open Samba's <span class="guiicon">Printers</span> +folder, right-click on the printer icon and select <span class="guimenu">Properties...</span>. You are now trying to +view printer and driver properties for a queue that has this default <tt class="constant">NULL</tt> driver +assigned. This will result in the following error message: +</p><p><span class="errorname"> + Device settings cannot be displayed. The driver for the specified printer is not installed, + only spooler properties will be displayed. Do you want to install the driver now? + </span></p><p> +Do not click on <span class="guibutton">Yes</span>! Instead, click on <span class="guibutton">No</span> in the error dialog. +Only now you will be presented with the printer properties window. From here, the way to assign a driver +to a printer is open to us. You now have the choice of: +</p><div class="itemizedlist"><ul type="disc"><li><p> + Select a driver from the pop-up list of installed drivers. Initially this list will be empty. + </p></li><li><p> + Click on <span class="guibutton">New Driver</span> to install a new printer driver (which will + start up the APW). + </p></li></ul></div><p> +Once the APW is started, the procedure is exactly the same as the one you are familiar with in Windows (we +assume here that you are familiar with the printer driver installations procedure on Windows NT). Make sure +your connection is, in fact, setup as a user with <a class="indexterm" name="id2925776"></a><i class="parameter"><tt>printer admin</tt></i> +privileges (if in doubt, use <b class="command">smbstatus</b> to check for this). If you wish to install +printer drivers for client operating systems other than <span class="application">Windows NT x86</span>, +you will need to use the <span class="guilabel">Sharing</span> tab of the printer properties dialog. </p><p> -Assuming you have connected with an administrative (or root) account -(as named by the <a class="indexterm" name="id2918510"></a><i class="parameter"><tt>printer admin</tt></i> parameter), -you will also be able to modify other printer properties such as ACLs -and default device settings using this dialog. For the default device -settings, please consider the advice given further below. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2918531"></a>Setting Drivers for existing Printers with -<b class="command">rpcclient</b></h3></div></div><div></div></div><p> -The second way to install printer drivers into -<i class="parameter"><tt>[print$]</tt></i> and set them up in a valid way can be -done from the UNIX command line. This involves four distinct steps: -</p><div class="orderedlist"><ol type="1"><li><p>gathering the info about the required driver files -and collecting the files together;</p></li><li><p>deposit the driver files into the -<i class="parameter"><tt>[print$]</tt></i> share's correct subdirectories -(possibly by using <b class="command">smbclient</b>);</p></li><li><p>running the <b class="command">rpcclient</b> -commandline utility once with the <b class="command">adddriver</b> -subcommand,</p></li><li><p>running <b class="command">rpcclient</b> a second -time with the <b class="command">setdriver</b> -subcommand.</p></li></ol></div><p> -We will provide detailed hints for each of these steps in the next few -paragraphs. -</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2918640"></a>Identifying the Driver Files</h4></div></div><div></div></div><p> -To find out about the driver files, you have two options: you could -investigate the driver CD which comes with your printer. Study the -<tt class="filename">*.inf</tt> file on the CD, if it is contained. This -may not be the possible, since the *.inf file might be -missing. Unfortunately, many vendors have now started to use their own -installation programs. These installations packages are often some -sort of Windows platform archive format, plus, the files may get -re-named during the installation process. This makes it extremely -difficult to identify the driver files you need. +Assuming you have connected with an administrative (or root) account (as named by the +<a class="indexterm" name="id2925818"></a><i class="parameter"><tt>printer admin</tt></i> parameter), you will also be able to modify +other printer properties such as ACLs and default device settings using this dialog. For the default +device settings, please consider the advice given further in <link linkend="inst-rpc">. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="inst-rpc"></a>Installing Print Drivers Using <b class="command">rpcclient</b></h3></div></div><div></div></div><p> +The second way to install printer drivers into <i class="parameter"><tt>[print$]</tt></i> and set them +up in a valid way is to do it from the UNIX command line. This involves four distinct steps: +</p><div class="orderedlist"><ol type="1"><li><p> + Gather info about required driver files and collect the files. + </p></li><li><p> + Deposit the driver files into the <i class="parameter"><tt>[print$]</tt></i> share's correct subdirectories + (possibly by using <b class="command">smbclient</b>). + </p></li><li><p> + Run the <b class="command">rpcclient</b> command line utility once with the <b class="command">adddriver</b> + subcommand. + </p></li><li><p> + Run <b class="command">rpcclient</b> a second time with the <b class="command">setdriver</b> subcommand. + </p></li></ol></div><p> +We provide detailed hints for each of these steps in the paragraphs that follow. +</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2925958"></a>Identifying Driver Files</h4></div></div><div></div></div><p> +To find out about the driver files, you have two options. You could check the contents of the driver +CDROM that came with your printer. Study the <tt class="filename">*.inf</tt> files lcoated on the CDROM. This +may not be possible, since the <tt class="filename">*.inf</tt> file might be missing. Unfortunately, vendors have now started +to use their own installation programs. These installations packages are often in some Windows platform +archive format. Additionally, the files may be re-named during the installation process. This makes it +extremely difficult to identify the driver files required. </p><p> -Then you only have the second option: install the driver first on a -Windows client *locally* and investigate which file names and paths it -uses after they are installed. (Note, that you need to repeat this -procedure for every client platform you want to support. We are going -to show it here for the <span class="application">W32X86</span> platform only, a -name used by Microsoft for all WinNT/2k/XP clients...) +Then you only have the second option. Install the driver locally on a Windows client and +investigate which file names and paths it uses after they are installed. (You need to repeat +this procedure for every client platform you want to support. We show it here for the +<span class="application">W32X86</span> platform only, a name used by Microsoft for all Windows NT/200x/XP +clients.) </p><p> -A good method to recognize the driver files this is to print the test -page from the driver's <span class="guilabel">Properties</span> Dialog -(<span class="guilabel">General</span> tab). Then look at the list of driver -files named on the printout. You'll need to recognize what Windows -(and Samba) are calling the <span class="guilabel">Driver File</span> , the -<span class="guilabel">Data File</span>, the <span class="guilabel">Config File</span>, -the <span class="guilabel">Help File</span> and (optionally) the -<span class="guilabel">Dependent Driver Files</span> (this may vary slightly -for Windows NT). You need to remember all names (or better take a -note) for the next steps. +A good method to recognize the driver files is to print the test page from the driver's +<span class="guilabel">Properties</span> dialog (<span class="guilabel">General</span> tab). Then look at the list of +driver files named on the printout. You'll need to recognize what Windows (and Samba) are calling the +<span class="guilabel">Driver File</span>, <span class="guilabel">Data File</span>, <span class="guilabel">Config File</span>, +<span class="guilabel">Help File</span> and (optionally) the <span class="guilabel">Dependent Driver Files</span> +(this may vary slightly for Windows NT). You need to take a note of all file names for the next steps. </p><p> -Another method to quickly test the driver filenames and related paths -is provided by the <b class="command">rpcclient</b> utility. Run it with -<b class="command">enumdrivers</b> or with the -<b class="command">getdriver</b> subcommand, each in the -<span class="emphasis"><em>3</em></span> level. In the following example, -<span class="emphasis"><em>TURBO_XP</em></span> is the name of the Windows PC (in this -case it was a Windows XP Professional laptop, BTW). I had installed -the driver locally to TURBO_XP while <span class="emphasis"><em>kde-bitshop</em></span> is -the name of the Linux host from which I am working. We could run an -<span class="emphasis"><em>interactive</em></span> <b class="command">rpcclient</b> session; -then we'd get an <span class="emphasis"><em>rpcclient /></em></span> prompt and would -type the subcommands at this prompt. This is left as a good exercise -to the reader. For now we use <b class="command">rpcclient</b> with the -<tt class="option">-c</tt> parameter to execute a single subcommand -line and exit again. This is the method you would use if you want to -create scripts to automate the procedure for a large number of -printers and drivers. Note the different quotes used to overcome the -different spaces in between words: +Another method to quickly test the driver filenames and related paths is provided by the +<b class="command">rpcclient</b> utility. Run it with <b class="command">enumdrivers</b> or with the +<b class="command">getdriver</b> subcommand, each at the <tt class="filename">3</tt> info level. In the following example, +<span class="emphasis"><em>TURBO_XP</em></span> is the name of the Windows PC (in this case it was a Windows XP Professional +laptop). I installed the driver locally to TURBO_XP, from a Samba server called <tt class="constant">KDE-BITSHOP</tt>. +We could run an interactive <b class="command">rpcclient</b> session; then we would get an +<b class="command">rpcclient /></b> prompt and would type the subcommands at this prompt. This is left as +a good exercise to the reader. For now, we use <b class="command">rpcclient</b> with the <tt class="option">-c</tt> +parameter to execute a single subcommand line and exit again. This is the method you would use if you +want to create scripts to automate the procedure for a large number of printers and drivers. Note the +different quotes used to overcome the different spaces in between words: </p><pre class="screen"> <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -U'Danka%xxxx' -c \ - 'getdriver "Heidelberg Digimaster 9110 (PS)" 3' TURBO_XP</tt></b> -cmd = getdriver "Heidelberg Digimaster 9110 (PS)" 3 + 'getdriver "Heidelberg Digimaster 9110 (PS)" 3' TURBO_XP</tt></b> +cmd = getdriver "Heidelberg Digimaster 9110 (PS)" 3 [Windows NT x86] Printer Driver Info 3: @@ -954,58 +813,47 @@ Printer Driver Info 3: Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.DLL] Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.INI] - Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1KMMin.DLL] Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.dat] Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.cat] Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.def] Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.hre] Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.vnd] Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.hlp] - Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de_reg.HLP] Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\HDNIS01Aux.dll] Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\HDNIS01_de.NTF] Monitorname: [] Defaultdatatype: [] </pre><p> -You may notice, that this driver has quite a big number of -<span class="guilabel">Dependentfiles</span> (I know worse cases however). Also, -strangely, the <span class="guilabel">Driver File</span> is here tagged as -<span class="guilabel">Driver Path</span>.... oh, well. Here we don't have yet -support for the so-called <span class="application">WIN40</span> architecture -installed. This name is used by Microsoft for the Win95/98/ME platforms. -If we want to support these, we need to install the Win95/98/ME driver -files in addition to those for <span class="application">W32X86</span> -(i.e. the WinNT72000/XP clients) onto a Windows PC. This PC -can also host the Win9x drivers, even if itself runs on Windows NT, -2000 or XP. +You may notice that this driver has quite a large number of <span class="guilabel">Dependent files</span> +(there are worse cases, however). Also, strangely, the +<span class="guilabel">Driver File</span> is tagged here +<span class="guilabel">Driver Path</span>. We do not yet have support for the so-called +<span class="application">WIN40</span> architecture installed. This name is used by Microsoft for the Windows +9x/Me platforms. If we want to support these, we need to install the Windows 9x/Me driver files in +addition to those for <span class="application">W32X86</span> (i.e., the Windows NT72000/XP clients) onto a +Windows PC. This PC can also host the Windows 9x/Me drivers, even if it runs on Windows NT, 2000 or XP. </p><p> -Since the <i class="parameter"><tt>[print$]</tt></i> share is usually accessible -through the <span class="guiicon">Network Neighbourhood</span>, you can also use the UNC notation -from Windows Explorer to poke at it. The Win9x driver files will end -up in subdirectory "0" of the "WIN40" directory. The full path to -access them will be -<tt class="filename">\\WINDOWSHOST\print$\WIN40\0\</tt>. -</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> more recent drivers on Windows 2000 and Windows XP are -installed into the "3" subdirectory instead of the "2". The version 2 -of drivers, as used in Windows NT, were running in Kernel Mode. -Windows 2000 changed this. While it still can use the Kernel Mode -drivers (if this is enabled by the Admin), its native mode for printer -drivers is User Mode execution. This requires drivers designed for -this. These type of drivers install into the "3" subdirectory. -</p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2919003"></a>Collecting the Driver Files from a Windows Host's -[print$] Share</h4></div></div><div></div></div><p> -Now we need to collect all the driver files we identified. in our -previous step. Where do we get them from? Well, why not retrieve them -from the very PC and the same <i class="parameter"><tt>[print$]</tt></i> share -which we investigated in our last step to identify the files? We can -use <b class="command">smbclient</b> to do this. We will use the paths and -names which were leaked to us by <b class="command">getdriver</b>. The +Since the <i class="parameter"><tt>[print$]</tt></i> share is usually accessible through the <span class="guiicon">Network +Neighborhood</span>, you can also use the UNC notation from Windows Explorer to poke at it. The Windows +9x/Me driver files will end up in subdirectory <tt class="filename">0</tt> of the <tt class="filename">WIN40</tt> +directory. The full path to access them will be <tt class="filename">\\WINDOWSHOST\print$\WIN40\0\</tt>. +</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> +More recent drivers on Windows 2000 and Windows XP are installed into the “<span class="quote">3</span>” subdirectory +instead of the “<span class="quote">2</span>”. The version 2 of drivers, as used in Windows NT, were running in Kernel +Mode. Windows 2000 changed this. While it still can use the Kernel Mode drivers (if this is enabled by +the Admin), its native mode for printer drivers is User Mode execution. This requires drivers designed +for this. These types of drivers install into the “<span class="quote">3</span>” subdirectory. +</p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2926311"></a>Obtaining Driver Files from Windows Client [print$] Shares</h4></div></div><div></div></div><p> +Now we need to collect all the driver files we identified in our previous step. Where do we get them +from? Well, why not retrieve them from the very PC and the same <i class="parameter"><tt>[print$]</tt></i> +share that we investigated in our last step to identify the files? We can use <b class="command">smbclient</b> +to do this. We will use the paths and names that were leaked to us by <b class="command">getdriver</b>. The listing is edited to include linebreaks for readability: </p><pre class="screen"> -<tt class="prompt">root# </tt><b class="userinput"><tt>smbclient //TURBO_XP/print\$ -U'Danka%xxxx' \ - -c 'cd W32X86/2;mget HD*_de.* \ - hd*ppd Hd*_de.* Hddm*dll HDN*Aux.DLL'</tt></b> +<tt class="prompt">root# </tt><b class="userinput"><tt>smbclient //TURBO_XP/print\$ -U'Danka%xxxx' \ + -c 'cd W32X86/2;mget HD*_de.* hd*ppd Hd*_de.* Hddm*dll HDN*Aux.DLL'</tt></b> + added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0 Got a positive name query response from 10.160.50.8 ( 10.160.50.8 ) Domain=[DEVELOPMENT] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager] @@ -1015,43 +863,38 @@ getting file \W32X86\2\Hddm91c1_de.def of size 428 as Hddm91c1_de.def <tt class="prompt">Get file Hddm91c1_de.DLL? </tt><b class="userinput"><tt>y</tt></b> getting file \W32X86\2\Hddm91c1_de.DLL of size 876544 as Hddm91c1_de.DLL [...] - </pre><p> -After this command is complete, the files are in our current local -directory. You probably have noticed that this time we passed several -commands to the <tt class="option">-c</tt> parameter, separated by semi-colons. This -effects that all commands are executed in sequence on the remote -Windows server before smbclient exits again. +After this command is complete, the files are in our current local directory. You probably have noticed +that this time we passed several commands to the <tt class="option">-c</tt> parameter, separated by semi-colons. +This effects that all commands are executed in sequence on the remote Windows server before smbclient +exits again. </p><p> -Don't forget to repeat the procedure for the <span class="application">WIN40</span> -architecture should you need to support Win95/98/XP clients. Remember, the -files for these architectures are in the WIN40/0/ subdir. Once we are -complete, we can run <b class="command">smbclient ... put</b> to store -the collected files on the Samba server's -<i class="parameter"><tt>[print$]</tt></i> share. -</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2919153"></a>Depositing the Driver Files into [print$]</h4></div></div><div></div></div><p> -So, now we are going to put the driver files into the -<i class="parameter"><tt>[print$]</tt></i> share. Remember, the UNIX path to this -share has been defined previously in your -. You also have created subdirectories -for the different Windows client types you want to support. Supposing -your <i class="parameter"><tt>[print$]</tt></i> share maps to the UNIX path -<tt class="filename">/etc/samba/drivers/</tt>, your driver files should now -go here: -</p><div class="itemizedlist"><ul type="disc"><li><p>for all Windows NT, 2000 and XP clients into -<tt class="filename">/etc/samba/drivers/W32X86/</tt> <span class="emphasis"><em>but -*not*(yet) into the "2" subdir</em></span>!</p></li><li><p>for all Windows 95, 98 and ME clients into -<tt class="filename">/etc/samba/drivers/WIN40/</tt> -- <span class="emphasis"><em>but *not* -(yet) into the "0" subdir</em></span>!</p></li></ul></div><p> -We again use smbclient to transfer the driver files across the -network. We specify the same files and paths as were leaked to us by -running <b class="command">getdriver</b> against the original -<span class="emphasis"><em>Windows</em></span> install. However, now we are going to -store the files into a <span class="emphasis"><em>Samba/UNIX</em></span> print server's -<i class="parameter"><tt>[print$]</tt></i> share... +Remember to repeat the procedure for the <span class="application">WIN40</span> architecture should +you need to support Windows 9x/Me/XP clients. Remember too, the files for these architectures are in the +<tt class="filename">WIN40/0/</tt> subdirectory. Once this is complete, we can run <b class="command">smbclient ... +put</b> to store the collected files on the Samba server's <i class="parameter"><tt>[print$]</tt></i> +share. +</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2926467"></a>Installing Driver Files into [print$]</h4></div></div><div></div></div><p> +We are now going to locate the driver files into the <i class="parameter"><tt>[print$]</tt></i> +share. Remember, the UNIX path to this share has been defined +previously in your words missing here. You +also have created subdirectories for the different Windows client types you want to +support. Supposing your <i class="parameter"><tt>[print$]</tt></i> share maps to the UNIX path +<tt class="filename">/etc/samba/drivers/</tt>, your driver files should now go here: +</p><div class="itemizedlist"><ul type="disc"><li><p> + For all Windows NT, 2000 and XP clients into <tt class="filename">/etc/samba/drivers/W32X86/</tt> but + not (yet) into the <tt class="filename">2</tt> subdirectory. + </p></li><li><p> + For all Windows 95, 98 and ME clients into <tt class="filename">/etc/samba/drivers/WIN40/</tt> but not + (yet) into the <tt class="filename">0</tt> subdirectory. + </p></li></ul></div><p> +We again use smbclient to transfer the driver files across the network. We specify the same files +and paths as were leaked to us by running <b class="command">getdriver</b> against the original +<span class="emphasis"><em>Windows</em></span> install. However, now we are going to store the files into a +<span class="emphasis"><em>Samba/UNIX</em></span> print server's <i class="parameter"><tt>[print$]</tt></i> share. </p><pre class="screen"> - <tt class="prompt">root# </tt><b class="userinput"><tt>smbclient //SAMBA-CUPS/print\$ -U'root%xxxx' -c \ - 'cd W32X86; put HDNIS01_de.DLL; \ +<tt class="prompt">root# </tt><b class="userinput"><tt>smbclient //SAMBA-CUPS/print\$ -U'root%xxxx' -c \ + 'cd W32X86; put HDNIS01_de.DLL; \ put Hddm91c1_de.ppd; put HDNIS01U_de.DLL; \ put HDNIS01U_de.HLP; put Hddm91c1_de.DLL; \ put Hddm91c1_de.INI; put Hddm91c1KMMin.DLL; \ @@ -1060,6 +903,7 @@ store the files into a <span class="emphasis"><em>Samba/UNIX</em></span> print s put Hddm91c1_de.vnd; put Hddm91c1_de.hlp; \ put Hddm91c1_de_reg.HLP; put HDNIS01Aux.dll; \ put HDNIS01_de.NTF'</tt></b> + added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0 Got a positive name query response from 10.160.51.162 ( 10.160.51.162 ) Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a] @@ -1080,30 +924,26 @@ putting file Hddm91c1_de_reg.HLP as \W32X86\Hddm91c1_de_reg.HLP putting file HDNIS01Aux.dll as \W32X86\HDNIS01Aux.dll putting file HDNIS01_de.NTF as \W32X86\HDNIS01_de.NTF </pre><p> -Phewww -- that was a lot of typing! Most drivers are a lot smaller -- -many only having 3 generic PostScript driver files plus 1 PPD. Note, -that while we did retrieve the files from the "2" subdirectory of the -"W32X86" directory from the Windows box, we <span class="emphasis"><em>don't</em></span> -put them (for now) in this same subdirectory of the Samba box! This -re-location will automatically be done by the -<b class="command">adddriver</b> command which we will run shortly (and -don't forget to also put the files for the Win95/98/ME architecture -into the <tt class="filename">WIN40/</tt> subdirectory should you need -them). -</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2919348"></a>Check if the Driver Files are there (with smbclient)</h4></div></div><div></div></div><p> -For now we verify that our files are there. This can be done with -<b class="command">smbclient</b> too (but of course you can log in via SSH -also and do this through a standard UNIX shell access too): + +Whew that was a lot of typing! Most drivers are a lot smaller many only having three generic +PostScript driver files plus one PPD. While we did retrieve the files from the <tt class="filename">2</tt> +subdirectory of the <tt class="filename">W32X86</tt> directory from the Windows box, we do not put them +(for now) in this same subdirectory of the Samba box. This relocation will automatically be done by the +<b class="command">adddriver</b> command, which we will run shortly (and do not forget to also put the files +for the Windows 9x/Me architecture into the <tt class="filename">WIN40/</tt> subdirectory should you need them). +</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2926676"></a><b class="command">smbclient</b> to Confirm Driver Installation</h4></div></div><div></div></div><p> +For now we verify that our files are there. This can be done with <b class="command">smbclient</b>, too +(but, of course, you can log in via SSH also and do this through a standard UNIX shell access): </p><pre class="screen"> <tt class="prompt">root# </tt><b class="userinput"><tt>smbclient //SAMBA-CUPS/print\$ -U 'root%xxxx' \ -c 'cd W32X86; pwd; dir; cd 2; pwd; dir'</tt></b> added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0 Got a positive name query response from 10.160.51.162 ( 10.160.51.162 ) -Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a] +Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.8a] Current directory is \\SAMBA-CUPS\print$\W32X86\ -. D 0 Sun May 4 03:56:35 2003 -.. D 0 Thu Apr 10 23:47:40 2003 +. D 0 Sun May 4 03:56:35 2003 +.. D 0 Thu Apr 10 23:47:40 2003 2 D 0 Sun May 4 03:56:18 2003 HDNIS01Aux.dll A 15356 Sun May 4 03:58:59 2003 Hddm91c1KMMin.DLL A 46966 Sun May 4 03:58:59 2003 @@ -1123,8 +963,8 @@ Hddm91c1_de_reg.HLP A 228417 Sun May 4 03:58:59 2003 40976 blocks of size 262144. 709 blocks available Current directory is \\SAMBA-CUPS\print$\W32X86\2\ -. D 0 Sun May 4 03:56:18 2003 -.. D 0 Sun May 4 03:56:35 2003 +. D 0 Sun May 4 03:56:18 2003 +.. D 0 Sun May 4 03:56:35 2003 ADOBEPS5.DLL A 434400 Sat May 3 23:18:45 2003 laserjet4.ppd A 9639 Thu Apr 24 01:05:32 2003 ADOBEPSU.DLL A 109568 Sat May 3 23:18:45 2003 @@ -1132,76 +972,64 @@ ADOBEPSU.HLP A 18082 Sat May 3 23:18:45 2003 PDFcreator2.PPD A 15746 Sun Apr 20 22:24:07 2003 40976 blocks of size 262144. 709 blocks available </pre><p> -Notice that there are already driver files present in the -<tt class="filename">2</tt> subdir (probably from a previous -installation). Once the files for the new driver are there too, you -are still a few steps away from being able to use them on the -clients. The only thing you could do *now* is to retrieve them from a -client just like you retrieve ordinary files from a file share, by -opening print$ in Windows Explorer. But that wouldn't install them per -Point'n'Print. The reason is: Samba doesn't know yet that these files -are something special, namely <span class="emphasis"><em>printer driver -files</em></span> and it doesn't know yet to which print queue(s) these -driver files belong. -</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2919464"></a>Running <b class="command">rpcclient</b> with -<b class="command">adddriver</b></h4></div></div><div></div></div><p> -So, next you must tell Samba about the special category of the files -you just uploaded into the <i class="parameter"><tt>[print$]</tt></i> share. This -is done by the <b class="command">adddriver</b> command. It will -prompt Samba to register the driver files into its internal TDB -database files. The following command and its output has been edited, -again, for readability: +Notice that there are already driver files present in the <tt class="filename">2</tt> subdirectory (probably +from a previous installation). Once the files for the new driver are there too, you are still a few +steps away from being able to use them on the clients. The only thing you could do now is to retrieve +them from a client just like you retrieve ordinary files from a file share, by opening print$ in Windows +Explorer. But that wouldn't install them per Point'n'Print. The reason +is: Samba does not yet know that +these files are something special, namely <span class="emphasis"><em>printer driver files</em></span> and it does not know +to which print queue(s) these driver files belong. +</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2926841"></a>Running <b class="command">rpcclient</b> with <b class="command">adddriver</b></h4></div></div><div></div></div><p> +Next, you must tell Samba about the special category of the files you just uploaded into the +<i class="parameter"><tt>[print$]</tt></i> share. This is done by the <b class="command">adddriver</b> +command. It will prompt Samba to register the driver files into its internal TDB database files. The +following command and its output has been edited, again, for readability: </p><pre class="screen"> - <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'adddriver "Windows NT x86" \ -"dm9110:HDNIS01_de.DLL: \ -Hddm91c1_de.ppd:HDNIS01U_de.DLL:HDNIS01U_de.HLP: \ - NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI, \ - Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre, \ - Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \ - HDNIS01Aux.dll,HDNIS01_de.NTF, \ - Hddm91c1_de_reg.HLP' SAMBA-CUPS</tt></b> +<tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'adddriver "Windows NT x86" \ + "dm9110:HDNIS01_de.DLL: \ + Hddm91c1_de.ppd:HDNIS01U_de.DLL:HDNIS01U_de.HLP: \ + NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI, \ + Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre, \ + Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \ + HDNIS01Aux.dll,HDNIS01_de.NTF, \ + Hddm91c1_de_reg.HLP' SAMBA-CUPS</tt></b> -cmd = adddriver "Windows NT x86" \ -"dm9110:HDNIS01_de.DLL:Hddm91c1_de.ppd:HDNIS01U_de.DLL: \ - HDNIS01U_de.HLP:NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI, \ - Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre, \ - Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \ - HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP" +cmd = adddriver "Windows NT x86" \ + "dm9110:HDNIS01_de.DLL:Hddm91c1_de.ppd:HDNIS01U_de.DLL: \ + HDNIS01U_de.HLP:NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI, \ + Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre, \ + Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \ + HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP" Printer Driver dm9110 successfully installed. - </pre><p> -After this step the driver should be recognized by Samba on the print -server. You need to be very careful when typing the command. Don't -exchange the order of the fields. Some changes would lead to a -<tt class="computeroutput">NT_STATUS_UNSUCCESSFUL</tt> error -message. These become obvious. Other changes might install the driver -files successfully, but render the driver unworkable. So take care! -Hints about the syntax of the adddriver command are in the man -page. The CUPS printing chapter of this HOWTO collection provides a -more detailed description, if you should need it. -</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2919577"></a>Check how Driver Files have been moved after -<b class="command">adddriver</b> finished</h4></div></div><div></div></div><p> -One indication for Samba's recognition of the files as driver files is -the <tt class="computeroutput">successfully installed</tt> message. -Another one is the fact, that our files have been moved by the -<b class="command">adddriver</b> command into the <tt class="filename">2</tt> -subdirectory. You can check this again with -<b class="command">smbclient</b>: +After this step, the driver should be recognized by Samba on the print server. You need to be very +careful when typing the command. Don't exchange the order of the fields. Some changes would lead to +an <tt class="computeroutput">NT_STATUS_UNSUCCESSFUL</tt> error message. These become obvious. Other +changes might install the driver files successfully, but render the driver unworkable. So take care! +Hints about the syntax of the adddriver command are in the man page. The CUPS printing chapter +provides a more detailed description, should you need it. +</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2926940"></a>Checking <b class="command">adddriver</b> Completion</h4></div></div><div></div></div><p> +One indication for Samba's recognition of the files as driver files is the <tt class="computeroutput">successfully +installed</tt> message. Another one is the fact that our files have been moved by the +<b class="command">adddriver</b> command into the <tt class="filename">2</tt> subdirectory. You can check this +again with <b class="command">smbclient</b>: </p><pre class="screen"> -<tt class="prompt">root# </tt><b class="userinput"><tt>smbclient //SAMBA-CUPS/print\$ -Uroot%xx -c 'cd W32X86;dir;pwd;cd 2;dir;pwd'</tt></b> +<tt class="prompt">root# </tt><b class="userinput"><tt>smbclient //SAMBA-CUPS/print\$ -Uroot%xx \ + -c 'cd W32X86;dir;pwd;cd 2;dir;pwd'</tt></b> added interface ip=10.160.51.162 bcast=10.160.51.255 nmask=255.255.252.0 Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a] Current directory is \\SAMBA-CUPS\print$\W32X86\ - . D 0 Sun May 4 04:32:48 2003 - .. D 0 Thu Apr 10 23:47:40 2003 + . D 0 Sun May 4 04:32:48 2003 + .. D 0 Thu Apr 10 23:47:40 2003 2 D 0 Sun May 4 04:32:48 2003 40976 blocks of size 262144. 731 blocks available Current directory is \\SAMBA-CUPS\print$\W32X86\2\ - . D 0 Sun May 4 04:32:48 2003 - .. D 0 Sun May 4 04:32:48 2003 + . D 0 Sun May 4 04:32:48 2003 + .. D 0 Sun May 4 04:32:48 2003 DigiMaster.PPD A 148336 Thu Apr 24 01:07:00 2003 ADOBEPS5.DLL A 434400 Sat May 3 23:18:45 2003 laserjet4.ppd A 9639 Thu Apr 24 01:05:32 2003 @@ -1224,62 +1052,54 @@ subdirectory. You can check this again with HDNIS01U_de.HLP A 19770 Sun May 4 04:32:18 2003 Hddm91c1_de_reg.HLP A 228417 Sun May 4 04:32:18 2003 40976 blocks of size 262144. 731 blocks available - </pre><p> -Another verification is that the timestamp of the printing TDB files -is now updated (and possibly their filesize has increased). -</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2919746"></a>Check if the Driver is recognized by Samba</h4></div></div><div></div></div><p> -Now the driver should be registered with Samba. We can easily verify -this, and will do so in a moment. However, this driver is -<span class="emphasis"><em>not yet</em></span> associated with a particular -<span class="emphasis"><em>printer</em></span>. We may check the driver status of the -files by at least three methods: -</p><div class="itemizedlist"><ul type="disc"><li><p>from any Windows client browse Network Neighbourhood, -find the Samba host and open the Samba <span class="guiicon">Printers and -Faxes</span> folder. Select any printer icon, right-click and -select the printer <span class="guimenuitem">Properties</span>. Click on the -<span class="guilabel">Advanced</span> tab. Here is a field indicating the -driver for that printer. A drop down menu allows you to change that -driver (be careful to not do this unwittingly.). You can use this -list to view all drivers know to Samba. Your new one should be amongst -them. (Each type of client will only see his own architecture's -list. If you don't have every driver installed for each platform, the -list will differ if you look at it from Windows95/98/ME or -WindowsNT/2000/XP.)</p></li><li><p>from a Windows 2000 or XP client (not WinNT) browse -<span class="guiicon">Network Neighbourhood</span>, search for the Samba -server and open the server's <span class="guiicon">Printers</span> folder, -right-click the white background (with no printer highlighted). Select -<span class="guimenuitem">Server Properties</span>. On the -<span class="guilabel">Drivers</span> tab you will see the new driver listed -now. This view enables you to also inspect the list of files belonging -to that driver<span class="emphasis"><em> (this doesn't work on Windows NT, but only on -Windows 2000 and Windows XP. WinNT doesn't provide the "Drivers" -tab).</em></span>. An alternative, much quicker method for Windows -2000/XP to start this dialog is by typing into a DOS box (you must of -course adapt the name to your Samba server instead of <i class="replaceable"><tt>SAMBA-CUPS</tt></i>): -</p><p><b class="userinput"><tt> rundll32 printui.dll,PrintUIEntry /s /t2 /n\\<i class="replaceable"><tt>SAMBA-CUPS</tt></i></tt></b></p></li><li><p>from a UNIX prompt run this command (or a variant -thereof), where <i class="replaceable"><tt>SAMBA-CUPS</tt></i> is the name of the Samba -host and "xxxx" represents the actual Samba password assigned to root: -</p><p><b class="userinput"><tt>rpcclient -U'root%xxxx' -c 'enumdrivers' <i class="replaceable"><tt>SAMBA-CUPS</tt></i></tt></b></p><p> -You will see a listing of all drivers Samba knows about. Your new one -should be amongst them. But it is only listed under the <i class="parameter"><tt>[Windows NT -x86]</tt></i> heading, not under <i class="parameter"><tt>[Windows 4.0]</tt></i>, -since we didn't install that part. Or did *you*? -- You will see a listing of -all drivers Samba knows about. Your new one should be amongst them. In our -example it is named <span class="emphasis"><em>dm9110</em></span>. Note that the 3rd column -shows the other installed drivers twice, for each supported architecture one -time. Our new driver only shows up for -<span class="application">Windows NT 4.0 or 2000</span>. To -have it present for <span class="application">Windows 95, 98 and ME</span> you'll -have to repeat the whole procedure with the WIN40 architecture and subdirectory. -</p></li></ul></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2919954"></a>A side note: you are not bound to specific driver names</h4></div></div><div></div></div><p> -You can name the driver as you like. If you repeat the -<b class="command">adddriver</b> step, with the same files as before, but -with a different driver name, it will work the same: +Another verification is that the timestamp of the printing TDB files is now updated +(and possibly their file size has increased). +</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2927063"></a>Check Samba for Driver Recognition</h4></div></div><div></div></div><p> +Now the driver should be registered with Samba. We can easily verify this, and will do so in a +moment. However, this driver is not yet associated with a particular printer. We may check the driver +status of the files by at least three methods: +</p><div class="itemizedlist"><ul type="disc"><li><p> + From any Windows client browse Network Neighborhood, find the Samba host and open the Samba + <span class="guiicon">Printers and Faxes</span> folder. Select any printer icon, right-click and select + the printer <span class="guimenuitem">Properties</span>. Click the <span class="guilabel">Advanced</span> + tab. Here is a field indicating the driver for that printer. A drop-down menu allows you to + change that driver (be careful not to do this unwittingly). You can use this list to view + all drivers known to Samba. Your new one should be among them. (Each type of client will only + see his own architecture's list. If you do not have every driver installed for each platform, + the list will differ if you look at it from Windows95/98/ME or WindowsNT/2000/XP.) + </p></li><li><p> + From a Windows 200x/XP client (not Windows NT) browse <span class="guiicon">Network Neighborhood</span>, + search for the Samba server and open the server's <span class="guiicon">Printers</span> folder, + right-click on the white background (with no printer highlighted). Select <span class="guimenuitem">Server + Properties</span>. On the <span class="guilabel">Drivers</span> tab you will see the new driver + listed. This view enables you to also inspect the list of files belonging to that driver + (this does not work on Windows NT, but only on Windows 2000 and Windows XP; Windows NT does not + provide the <span class="guimenuitem">Drivers</span> tab). An + alternative and much quicker method for + Windows 2000/XP to start this dialog is by typing into a DOS box (you must of course adapt the + name to your Samba server instead of <i class="replaceable"><tt>SAMBA-CUPS</tt></i>): + </p><p><b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /s /t2 /n\\<i class="replaceable"><tt>SAMBA-CUPS</tt></i></tt></b></p></li><li><p> + From a UNIX prompt, run this command (or a variant thereof) where + <i class="replaceable"><tt>SAMBA-CUPS</tt></i> is the name of the Samba host and xxxx represents the + actual Samba password assigned to root: + </p><p><b class="userinput"><tt>rpcclient -U'root%xxxx' -c 'enumdrivers' <i class="replaceable"><tt>SAMBA-CUPS</tt></i></tt></b></p><p> + You will see a listing of all drivers Samba knows about. Your new one should be among + them. But it is only listed under the <i class="parameter"><tt>[Windows NT x86]</tt></i> heading, not under + <i class="parameter"><tt>[Windows 4.0]</tt></i>, since you didn't install that part. Or did you? + You will see a listing of all drivers Samba knows about. Your new one should be among them. In + our example it is named <tt class="constant">dm9110</tt>. Note that the third column shows the other + installed drivers twice, one time for each supported architecture. Our new driver only shows up + for <span class="application">Windows NT 4.0 or 2000</span>. To have it present for <span class="application">Windows + 95, 98 and ME</span>, you'll have to repeat the whole procedure with the WIN40 architecture + and subdirectory. + </p></li></ul></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2927262"></a>Specific Driver Name Flexibility</h4></div></div><div></div></div><p> +You can name the driver as you like. If you repeat the <b class="command">adddriver</b> step with the same +files as before but with a different driver name, it will work the same: </p><pre class="screen"> -<tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx \ - -c 'adddriver "Windows NT x86" \ - "myphantasydrivername:HDNIS01_de.DLL: \ +<tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx \ + -c 'adddriver "Windows NT x86" \ + "mydrivername:HDNIS01_de.DLL: \ Hddm91c1_de.ppd:HDNIS01U_de.DLL:HDNIS01U_de.HLP: \ NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI, \ Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre, \ @@ -1287,345 +1107,292 @@ with a different driver name, it will work the same: HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP' SAMBA-CUPS </tt></b> - cmd = adddriver "Windows NT x86" - "myphantasydrivername:HDNIS01_de.DLL:Hddm91c1_de.ppd:HDNIS01U_de.DLL:\ - HDNIS01U_de.HLP:NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI, \ - Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre, \ - Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \ - HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP" - - Printer Driver myphantasydrivername successfully installed. +cmd = adddriver "Windows NT x86" \ + "mydrivername:HDNIS01_de.DLL:Hddm91c1_de.ppd:HDNIS01U_de.DLL:\ + HDNIS01U_de.HLP:NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI, \ + Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre, \ + Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \ + HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP" +Printer Driver mydrivername successfully installed. </pre><p> -You will also be able to bind that driver to any print queue (however, -you are responsible yourself that you associate drivers to queues -which make sense to the target printer). Note, that you can't run the -<b class="command">rpcclient</b> <b class="command">adddriver</b> command -repeatedly. Each run "consumes" the files you had put into the -<i class="parameter"><tt>[print$]</tt></i> share by moving them into the -respective subdirectories. So you <span class="emphasis"><em>must</em></span> precede an -<b class="command">smbclient ... put</b> command before each -<b class="command">rpcclient ... adddriver</b>" command. -</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2920088"></a>Running <b class="command">rpcclient</b> with -<b class="command">setdriver</b></h4></div></div><div></div></div><p> -Samba still needs to know <span class="emphasis"><em>which</em></span> printer's driver -this is. It needs to create a mapping of the driver to a printer, and -store this info in its "memory", the TDB files. The <b class="command">rpcclient -setdriver</b> command achieves exactly this: +You will be able to bind that driver to any print queue (however, you are responsible that +you associate drivers to queues that make sense with respect to target printers). You cannot run the +<b class="command">rpcclient</b> <b class="command">adddriver</b> command repeatedly. Each run consumes the +files you had put into the <i class="parameter"><tt>[print$]</tt></i> share by moving them into the +respective subdirectories. So you must execute an <b class="command">smbclient ... put</b> command before +each <b class="command">rpcclient ... adddriver</b> command. +</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2927366"></a>Running <b class="command">rpcclient</b> with the <b class="command">setdriver</b></h4></div></div><div></div></div><p> +Samba needs to know which printer owns which driver. Create a mapping of the driver to a printer, and +store this info in Samba's memory, the TDB files. The <b class="command">rpcclient setdriver</b> command +achieves exactly this: </p><pre class="screen"> -<tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -U'root%xxxx' -c 'setdriver dm9110 myphantasydrivername' <i class="replaceable"><tt>SAMBA-CUPS</tt></i></tt></b> - cmd = setdriver dm9110 myphantasydrivername - Successfully set dm9110 to driver myphantasydrivername. +<tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -U'root%xxxx' -c 'setdriver dm9110 mydrivername' <i class="replaceable"><tt>SAMBA-CUPS</tt></i></tt></b> + cmd = setdriver dm9110 mydrivername + +Successfully set dm9110 to driver mydrivername. </pre><p> -Ahhhhh -- no, I didn't want to do that. Repeat, this time with the -name I intended: +Ah, no, I did not want to do that. Repeat, this time with the name I intended: </p><pre class="screen"> <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -U'root%xxxx' -c 'setdriver dm9110 dm9110' <i class="replaceable"><tt>SAMBA-CUPS</tt></i></tt></b> cmd = setdriver dm9110 dm9110 - Successfully set dm9110 to driver dm9110. +Successfully set dm9110 to driver dm9110. +</pre><p> +The syntax of the command is: +</p><pre class="screen"> +<b class="userinput"><tt>rpcclient -U'root%<i class="replaceable"><tt>sambapassword</tt></i>' -c 'setdriver <i class="replaceable"><tt>printername</tt></i> \ + <i class="replaceable"><tt>drivername</tt></i>' <i class="replaceable"><tt>SAMBA-Hostname</tt></i></tt></b>. </pre><p> -The syntax of the command is <b class="userinput"><tt>rpcclient --U'root%<i class="replaceable"><tt>sambapassword</tt></i>' -c 'setdriver -"<i class="replaceable"><tt>printername</tt></i>" -"<i class="replaceable"><tt>drivername</tt></i>' -<i class="replaceable"><tt>SAMBA-Hostname</tt></i></tt></b> . -- -Now we have done *most* of the work. But not yet all.... +Now we have done most of the work, but not all of it. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> -the <b class="command">setdriver</b> command will only succeed if the printer is -known to -Samba already. A bug in 2.2.x prevented Samba from recognizing freshly -installed printers. You had to restart Samba, or at least send a HUP -signal to all running smbd processes to work around this: -<b class="userinput"><tt>kill -HUP `pidof smbd`</tt></b>. </p></div></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2920241"></a>Client Driver Install Procedure</h2></div></div><div></div></div><p> -A famous philosopher said once: “<span class="quote">The Proof of the Pudding lies -in the Eating</span>”. The proof for our setup lies in the printing. -So let's install the printer driver onto the client PCs. This is not -as straightforward as it may seem. Read on. -</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2920260"></a>The first Client Driver Installation</h3></div></div><div></div></div><p> -Especially important is the installation onto the first client PC (for -each architectural platform separately). Once this is done correctly, -all further clients are easy to setup and shouldn't need further -attention. What follows is a description for the recommended first -procedure. You work now from a client workstation. First you should -guarantee that your connection is not unwittingly mapped to -<span class="emphasis"><em>bad user</em></span> "nobody". In a DOS box type: +The <b class="command">setdriver</b> command will only succeed if the +printer is already known to Samba. A +bug in 2.2.x prevented Samba from recognizing freshly installed printers. You had to restart Samba, +or at least send an HUP signal to all running smbd processes to work around this: <b class="userinput"><tt>kill -HUP +`pidof smbd`</tt></b>. +</p></div></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2927518"></a>Client Driver Installation Procedure</h2></div></div><div></div></div><p> +As Don Quixote said: “<span class="quote">The proof of the pudding is in the eating.</span>” The proof +for our setup lies in the printing. So let's install the printer driver onto the client PCs. This is +not as straightforward as it may seem. Read on. +</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2927537"></a>First Client Driver Installation</h3></div></div><div></div></div><p> +Especially important is the installation onto the first client PC (for each architectural platform +separately). Once this is done correctly, all further clients are easy to setup and shouldn't need further +attention. What follows is a description for the recommended first procedure. You work now from a client +workstation. You should guarantee that your connection is not unwittingly mapped to <span class="emphasis"><em>bad +user</em></span> nobody. In a DOS box type: </p><p><b class="userinput"><tt>net use \\<i class="replaceable"><tt>SAMBA-SERVER</tt></i>\print$ /user:root</tt></b></p><p> -Replace root, if needed, by another valid -<i class="replaceable"><tt>printer admin</tt></i> user as given in the definition. -Should you already be connected as a different user, you'll get an error -message. There is no easy way to get rid of that connection, because -Windows doesn't seem to know a concept of "logging off" from a share -connection (don't confuse this with logging off from the local -workstation; that is a different matter). You can try to close -<span class="emphasis"><em>all</em></span> Windows file explorer and Internet Explorer -windows. As a last resort, you may have to reboot. Make sure there is -no automatic re-connection set up. It may be easier to go to a -different workstation and try from there. After you have made sure you -are connected as a printer admin user (you can check this with the -<b class="command">smbstatus</b> command on Samba) do this from the -Windows workstation: -</p><div class="itemizedlist"><ul type="disc"><li><p>Open <span class="guiicon">Network -Neighbourhood</span></p></li><li><p>Browse to Samba server</p></li><li><p>Open its <span class="guiicon">Printers and -Faxes</span> folder</p></li><li><p>Highlight and right-click the printer</p></li><li><p>Select <span class="guimenuitem">Connect...</span> (for WinNT4/2K -it is possibly <span class="guimenuitem">Install...</span>)</p></li></ul></div><p> -A new printer (named <i class="replaceable"><tt>printername</tt></i> on -samba-server) should now have appeared in your -<span class="emphasis"><em>local</em></span> Printer folder (check <span class="guimenu">Start</span> -- -<span class="guimenuitem">Settings</span> -- <span class="guimenuitem">Control Panel</span> --- <span class="guiicon">Printers and Faxes</span>). +Replace root, if needed, by another valid <a class="indexterm" name="id2927577"></a><i class="parameter"><tt>printer admin</tt></i> user as given in +the definition. Should you already be connected as a different user, you will get an error message. There +is no easy way to get rid of that connection, because Windows does not seem to know a concept of logging +off from a share connection (do not confuse this with logging off from the local workstation; that is +a different matter). You can try to close all Windows file explorer +and Internet Explorer for Windows. As +a last resort, you may have to reboot. Make sure there is no automatic reconnection set up. It may be +easier to go to a different workstation and try from there. After you have made sure you are connected +as a printer admin user (you can check this with the <b class="command">smbstatus</b> command on Samba), +do this from the Windows workstation: +</p><div class="procedure"><ol type="1"><li><p> + Open <span class="guiicon">Network Neighborhood</span>. + </p></li><li><p> + Browse to Samba server. + </p></li><li><p> + Open its <span class="guiicon">Printers and Faxes</span> folder. + </p></li><li><p> + Highlight and right-click on the printer. + </p></li><li><p> + Select <span class="guimenuitem">Connect</span> (for Windows NT4/200x + it is possibly <span class="guimenuitem">Install</span>). + </p></li></ol></div><p> +A new printer (named <i class="replaceable"><tt>printername</tt></i> on Samba-server) should now have +appeared in your <span class="emphasis"><em>local</em></span> Printer folder (check <span class="guimenu">Start</span> -- +<span class="guimenuitem">Settings</span> -- <span class="guimenuitem">Control Panel</span> -- <span class="guiicon">Printers +and Faxes</span>). </p><p> -Most likely you are now tempted to try and print a test page. After -all, you now can open the printer properties and on the "General" tab, -there is a button offering to do just that. But chances are that you -get an error message saying <span class="errorname">Unable to print Test -Page</span>. The reason might be that there is not yet a -valid Device Mode set for the driver, or that the "Printer Driver -Data" set is still incomplete. +Most likely you are now tempted to try to print a test page. After all, you now can open the printer +properties, and on the <span class="guimenu">General</span> tab there is a button offering to do just that. But +chances are that you get an error message saying <span class="errorname">Unable to print Test Page</span>. The +reason might be that there is not yet a valid Device Mode set for the driver, or that the “<span class="quote">Printer +Driver Data</span>” set is still incomplete. </p><p> -You must now make sure that a valid "Device Mode" is set for the -driver. Don't fear -- we will explain now what that means. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2920462"></a>IMPORTANT! Setting Device Modes on new Printers</h3></div></div><div></div></div><p> -In order for a printer to be truly usable by a Windows NT/2K/XP -client, it must possess: -</p><div class="itemizedlist"><ul type="disc"><li><p>a valid <span class="emphasis"><em>Device Mode</em></span> generated by -the driver for the printer (defining things like paper size, -orientation and duplex settings), and</p></li><li><p>a complete set of -<span class="emphasis"><em>Printer Driver Data</em></span> generated by the -driver.</p></li></ul></div><p> -If either one of these is incomplete, the clients can produce less -than optimal output at best. In the worst cases, unreadable garbage or -nothing at all comes from the printer or they produce a harvest of -error messages when attempting to print. Samba stores the named values -and all printing related info in its internal TDB database files -<tt class="filename">(ntprinters.tdb</tt>, -<tt class="filename">ntdrivers.tdb</tt>, <tt class="filename">printing.tdb</tt> -and <tt class="filename">ntforms.tdb</tt>). +You must make sure that a valid <i class="parameter"><tt>Device Mode</tt></i> is set for the +driver. We now explain what that means. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2927769"></a>Setting Device Modes on New Printers</h3></div></div><div></div></div><p> +For a printer to be truly usable by a Windows NT/200x/XP client, it must possess: +</p><div class="itemizedlist"><ul type="disc"><li><p> + A valid <span class="emphasis"><em>Device Mode</em></span> generated by the driver for the printer (defining things + like paper size, orientation and duplex settings). + </p></li><li><p> + A complete set of <span class="emphasis"><em>Printer Driver Data</em></span> generated by the driver. + </p></li></ul></div><p> +If either of these is incomplete, the clients can produce less than optimal output at best. In the +worst cases, unreadable garbage or nothing at all comes from the printer or it produces a harvest of +error messages when attempting to print. Samba stores the named values and all printing related information in +its internal TDB database files <tt class="filename">(ntprinters.tdb</tt>, <tt class="filename">ntdrivers.tdb</tt>, +<tt class="filename">printing.tdb</tt> and <tt class="filename">ntforms.tdb</tt>). </p><p> -What do these two words stand for? Basically, the Device Mode and the -set of Printer Driver Data is a collection of settings for all print -queue properties, initialized in a sensible way. Device Modes and -Printer Driver Data should initially be set on the print server (that is -here: the Samba host) to healthy values so that the clients can start -to use them immediately. How do we set these initial healthy values? -This can be achieved by accessing the drivers remotely from an NT (or -2k/XP) client, as is discussed in the next paragraphs. +What do these two words stand for? Basically, the Device Mode and the set of Printer Driver Data is a +collection of settings for all print queue properties, initialized in a sensible way. Device Modes and +Printer Driver Data should initially be set on the print server (the Samba host) to healthy +values so the clients can start to use them immediately. How do we set these initial healthy values? +This can be achieved by accessing the drivers remotely from an NT (or 200x/XP) client, as is discussed +in the following paragraphs. </p><p> -Be aware, that a valid Device Mode can only be initiated by a -<a class="indexterm" name="id2920558"></a><i class="parameter"><tt>printer admin</tt></i>, or root (the reason should be -obvious). Device Modes can only correctly be set by executing the -printer driver program itself. Since Samba can not execute this Win32 -platform driver code, it sets this field initially to NULL (which is -not a valid setting for clients to use). Fortunately, most drivers -generate themselves the Printer Driver Data that is needed, when they -are uploaded to the <i class="parameter"><tt>[print$]</tt></i> share with the -help of the APW or rpcclient. +Be aware that a valid Device Mode can only be initiated by a +<a class="indexterm" name="id2927864"></a><i class="parameter"><tt>printer admin</tt></i>, or root +(the reason should be obvious). Device Modes can only be correctly +set by executing the printer driver program itself. Since Samba cannot execute this Win32 platform driver +code, it sets this field initially to NULL (which is not a valid setting for clients to use). Fortunately, +most drivers automatically generate the Printer Driver Data that is needed when they are uploaded to the +<i class="parameter"><tt>[print$]</tt></i> share with the help of the APW or rpcclient. </p><p> -The generation and setting of a first valid Device Mode however -requires some "tickling" from a client, to set it on the Samba -server. The easiest means of doing so is to simply change the page -orientation on the server's printer. This "executes" enough of the -printer driver program on the client for the desired effect to happen, -and feeds back the new Device Mode to our Samba server. You can use the -native Windows NT/2K/XP printer properties page from a Window client -for this: -</p><div class="itemizedlist"><ul type="disc"><li><p>Browse the <span class="guiicon">Network Neighbourhood</span></p></li><li><p>Find the Samba server</p></li><li><p>Open the Samba server's <span class="guiicon">Printers and - Faxes</span> folder</p></li><li><p>Highlight the shared printer in question</p></li><li><p>Right-click the printer (you may already be here, if you -followed the last section's description)</p></li><li><p>At the bottom of the context menu select -<span class="guimenu">Properties....</span> (if the menu still offers the -<span class="guimenuitem">Connect...</span> entry -further above, you need to click that one first to achieve the driver -installation as shown in the last section)</p></li><li><p>Go to the <span class="guilabel">Advanced</span> tab; click on -<span class="guibutton">Printing Defaults...</span></p></li><li><p>Change the "Portrait" page setting to "Landscape" (and -back)</p></li><li><p>(Oh, and make sure to <span class="emphasis"><em>apply</em></span> -changes between swapping the page orientation to cause the change to -actually take effect...).</p></li><li><p>While you're at it, you may optionally also want to -set the desired printing defaults here, which then apply to all future -client driver installations on the remaining from now -on.</p></li></ul></div><p> -This procedure has executed the printer driver program on the client -platform and fed back the correct Device Mode to Samba, which now -stored it in its TDB files. Once the driver is installed on the -client, you can follow the analogous steps by accessing the -<span class="emphasis"><em>local</em></span> <span class="guiicon">Printers</span> folder too if you are -a Samba printer admin user. From now on printing should work as expected. +The generation and setting of a first valid Device Mode, however, requires some tickling from a client, +to set it on the Samba server. The easiest means of doing so is to simply change the page orientation on +the server's printer. This executes enough of the printer driver program on the client for the desired +effect to happen, and feeds back the new Device Mode to our Samba server. You can use the native Windows +NT/200x/XP printer properties page from a Window client for this: +</p><div class="procedure"><ol type="1"><li><p> + Browse the <span class="guiicon">Network Neighborhood.</span> + </p></li><li><p> + Find the Samba server. + </p></li><li><p> + Open the Samba server's <span class="guiicon">Printers and Faxes</span> folder. + </p></li><li><p> + Highlight the shared printer in question. + </p></li><li><p> + Right-click on the printer (you may already be here, if you followed the last section's description). + </p></li><li><p> + At the bottom of the context menu select <span class="guimenu">Properties</span> (if the menu still offers the + <span class="guimenuitem">Connect</span> entry further above, you + need to click on that one first to achieve the driver + installation as shown in the last section). + </p></li><li><p> + Go to the <span class="guilabel">Advanced</span> tab; click on <span class="guibutton">Printing Defaults</span>. + </p></li><li><p> + Change the <span class="guimenuitem">Portrait</span> page setting to <span class="guimenuitem">Landscape</span> (and back). + </p></li><li><p> + Make sure to apply changes between swapping the page orientation to cause the change to actually take effect. + </p></li><li><p> + While you are at it, you may also want to set the desired printing defaults here, which then apply to all future + client driver installations on the remaining from now on. + </p></li></ol></div><p> +This procedure has executed the printer driver program on the client platform and fed back the correct +Device Mode to Samba, which now stored it in its TDB files. Once the driver is installed on the client, +you can follow the analogous steps by accessing the <span class="emphasis"><em>local</em></span> <span class="guiicon">Printers</span> +folder, too, if you are a Samba printer admin user. From now on, printing should work as expected. </p><p> -Samba also includes a service level parameter name <i class="parameter"><tt>default -devmode</tt></i> for generating a default Device Mode for a -printer. Some drivers will function well with Samba's default set of -properties. Others may crash the client's spooler service. So use this -parameter with caution. It is always better to have the client -generate a valid device mode for the printer and store it on the -server for you. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2920763"></a>Further Client Driver Install Procedures</h3></div></div><div></div></div><p> -Every further driver may be done by any user, along the lines -described above: Browse network, open printers folder on Samba server, -right-click printer and choose <span class="guimenuitem">Connect...</span>. Once -this completes (should be not more than a few seconds, but could also take -a minute, depending on network conditions), you should find the new printer in -your client workstation local <span class="guiicon">Printers and -Faxes</span> folder. +Samba includes a service level parameter name <i class="parameter"><tt>default devmode</tt></i> for generating a default +Device Mode for a printer. Some drivers will function well with Samba's default set of properties. Others +may crash the client's spooler service. So use this parameter with caution. It is always better to have +the client generate a valid device mode for the printer and store it on the server for you. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2928112"></a>Additional Client Driver Installation</h3></div></div><div></div></div><p> +Every additional driver may be installed, along the lines described +above. Browse network, open the +<span class="guiicon">Printers</span> folder on Samba server, right-click on <span class="guiicon">Printer</span> and choose +<span class="guimenuitem">Connect...</span>. Once this completes (should be not more than a few seconds, +but could also take a minute, depending on network conditions), you should find the new printer in your +client workstation local <span class="guiicon">Printers and Faxes</span> folder. </p><p> You can also open your local <span class="guiicon">Printers and Faxes</span> folder by -using this command on Windows 2000 and Windows XP Professional workstations: -</p><p><b class="userinput"><tt>rundll32 shell32.dll,SHHelpShortcuts_RunDLL PrintersFolder -</tt></b></p><p> +using this command on Windows 200x/XP Professional workstations: +</p><p><b class="userinput"><tt>rundll32 shell32.dll,SHHelpShortcuts_RunDLL PrintersFolder</tt></b></p><p> or this command on Windows NT 4.0 workstations: </p><p><b class="userinput"><tt> rundll32 shell32.dll,Control_RunDLL MAIN.CPL @2 </tt></b></p><p> -You can enter the commands either inside a <span class="guilabel">DOS box</span> window -or in the <span class="guimenuitem">Run command...</span> field from the -<span class="guimenu">Start</span> menu. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2920857"></a>Always make first Client Connection as root or "printer admin"</h3></div></div><div></div></div><p> -After you installed the driver on the Samba server (in its -<i class="parameter"><tt>[print$]</tt></i> share, you should always make sure -that your first client installation completes correctly. Make it a habit for -yourself to build that the very first connection from a client as -<a class="indexterm" name="id2920879"></a><i class="parameter"><tt>printer admin</tt></i>. This is to make sure that: -</p><div class="itemizedlist"><ul type="disc"><li><p> a first valid <span class="emphasis"><em>Device Mode</em></span> is -really initialized (see above for more explanation details), and -that</p></li><li><p> the default print settings of your printer for all -further client installations are as you want them</p></li></ul></div><p> -Do this by changing the orientation to landscape, click -<span class="emphasis"><em>Apply</em></span>, and then change it back again. Then modify -the other settings (for example, you don't want the default media size -set to <span class="emphasis"><em>Letter</em></span>, when you are all using -<span class="emphasis"><em>A4</em></span>, right? You may want to set the printer for -<span class="emphasis"><em>duplex</em></span> as the default; etc.). +You can enter the commands either inside a <span class="guilabel">DOS box</span> window or in the <span class="guimenuitem">Run +command...</span> field from the <span class="guimenu">Start</span> menu. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2928220"></a>Always Make First Client Connection as root or “<span class="quote">printer admin</span>”</h3></div></div><div></div></div><p> +After you installed the driver on the Samba server (in its <i class="parameter"><tt>[print$]</tt></i> +share, you should always make sure that your first client installation completes correctly. Make it a +habit for yourself to build the very first connection from a client as <a class="indexterm" name="id2928244"></a><i class="parameter"><tt>printer admin</tt></i>. This is to make sure that: +</p><div class="itemizedlist"><ul type="disc"><li><p> + A first valid <span class="emphasis"><em>Device Mode</em></span> is really initialized (see above for more + explanation details). + </p></li><li><p> + The default print settings of your printer for all further client installations are as you want them. + </p></li></ul></div><p> +Do this by changing the orientation to landscape, click on <span class="guiicon">Apply</span>, and then change it +back again. Next, modify the other settings (for example, you do not want the default media size set to +<span class="guiicon">Letter</span> when you are all using <span class="guiicon">A4</span>, right? You may want to set the +printer for <span class="guiicon">duplex</span> as the default, and so on). </p><p> -To connect as root to a Samba printer, try this command from a Windows -2K/XP DOS box command prompt: +To connect as root to a Samba printer, try this command from a Windows 200x/XP DOS box command prompt: </p><pre class="screen"> -<tt class="prompt">C:\> </tt><b class="userinput"><tt>runas /netonly /user:root "rundll32 printui.dll,PrintUIEntry /p /t3 /n - \\<i class="replaceable"><tt>SAMBA-SERVER</tt></i>\<i class="replaceable"><tt>printername</tt></i>"</tt></b> +<tt class="prompt">C:\> </tt><b class="userinput"><tt>runas /netonly /user:root "rundll32 printui.dll,PrintUIEntry /p /t3 /n + \\<i class="replaceable"><tt>SAMBA-SERVER</tt></i>\<i class="replaceable"><tt>printername</tt></i>"</tt></b> </pre><p> </p><p> You will be prompted for root's Samba-password; type it, wait a few -seconds, click on <span class="guibutton">Printing Defaults...</span> and -proceed to set the job options as should be used as defaults by all -clients. Alternatively, instead of root you can name one other member -of the <a class="indexterm" name="id2921000"></a><i class="parameter"><tt>printer admin</tt></i> from the setting. +seconds, click on <span class="guibutton">Printing +Defaults</span>, and proceed to set the job options that should be used as defaults by all +clients. Alternately, instead of root you can name one other member of the <a class="indexterm" name="id2928372"></a><i class="parameter"><tt>printer admin</tt></i> from the setting. </p><p> -Now all the other users downloading and installing the driver -the same way (called <span class="emphasis"><em>Point'n'Print</em></span>) will -have the same defaults set for them. If you miss this step you'll -get a lot of helpdesk calls from your users. But maybe you like to -talk to people.... ;-) -</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2921029"></a>Other Gotchas</h2></div></div><div></div></div><p> -Your driver is installed. It is ready for -<span class="emphasis"><em>Point'n'Print</em></span> installation by the clients -now. You <span class="emphasis"><em>may</em></span> have tried to download and use it -onto your first client machine now. But wait... let's make you -acquainted first with a few tips and tricks you may find useful. For -example, suppose you didn't manage to "set the defaults" on the -printer, as advised in the preceding paragraphs? And your users -complain about various issues (such as “<span class="quote">We need to set the paper -size for each job from Letter to A4 and it won't store it!</span>”) -</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2921063"></a>Setting Default Print Options for the Client Drivers</h3></div></div><div></div></div><p> + Now all the other users downloading and installing the driver the same way (called +“<span class="quote">Point'n'Print</span>”) will have the same defaults set for them. If you miss this step +you'll get a lot of Help Desk calls from your users, but maybe you like to talk to people. +</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2928404"></a>Other Gotchas</h2></div></div><div></div></div><p> +Your driver is installed. It is now ready for Point'n'Print +installation by the clients. You may have tried to download and use it +onto your first client machine, but +wait. Let's make sure you are acquainted first with a few tips and tricks you may find useful. For example, +suppose you did not set the defaults on the printer, as advised in the preceding +paragraphs. Your users complain about various issues (such as, “<span class="quote">We need to set the paper size +for each job from Letter to A4 and it will not store it.</span>”) +</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2928430"></a>Setting Default Print Options for Client Drivers</h3></div></div><div></div></div><p> The last sentence might be viewed with mixed feelings by some users and -admins. They have struggled for hours and hours and couldn't arrive at -a point were their settings seemed to be saved. It is not their -fault. The confusing thing is this: in the multi-tabbed dialog that pops -up when you right-click the printer name and select -<span class="guimenuitem">Properties...</span>, you can arrive at two identically -looking dialogs, each claiming that they help you to set printer options, -in three different ways. Here is the definite answer to the "Samba -Default Driver Setting FAQ": -</p><p><b>“<span class="quote">I can't set and save default print options -for all users on Win2K/XP! Why not?</span>” </b> -How are you doing it? I bet the wrong way.... (it is not very -easy to find out, though). There are 3 different ways to bring you to -a dialog that <span class="emphasis"><em>seems</em></span> to set everything. All three -dialogs <span class="emphasis"><em>look</em></span> the same. Only one of them -<span class="emphasis"><em>does</em></span> what you intend. -<span class="emphasis"><em>Important:</em></span> you need to be Administrator or Print -Administrator to do this for all users. Here is how I reproduce it in -on XP Professional: - -</p><div class="orderedlist"><ol type="A"><li><p>The first "wrong" way: - -</p><div class="orderedlist"><ol type="1"><li><p>Open the <span class="guiicon">Printers</span> -folder.</p></li><li><p>Right-click on the printer -(<span class="emphasis"><em>remoteprinter on cupshost</em></span>) and -select in context menu <span class="guimenu">Printing -Preferences...</span></p></li><li><p>Look at this dialog closely and remember what it looks -like.</p></li></ol></div><p> -</p></li><li><p>The second "wrong" way: +admins. They have struggled for hours and could not arrive at a point +where their settings seemed to be saved. It is not their fault. The confusing +thing is that in the multi-tabbed dialog that pops up when you right-click +on the printer name and select <span class="guimenuitem">Properties</span>, you +can arrive at two dialogs that appear identical, each claiming that they help +you to set printer options in three different ways. Here is the definite +answer to the Samba default driver setting FAQ: +</p><p><b>“<span class="quote">I can not set and save default print options +for all users on Windows 200x/XP. Why not?</span>” </b> +How are you doing it? I bet the wrong way. (It is not easy to find out, though). There are three different +ways to bring you to a dialog that seems to set everything. All three +dialogs look the same, but only one +of them does what you intend. You need to be Administrator or Print Administrator to do this for all +users. Here is how I reproduce it in an XP Professional: -</p><div class="orderedlist"><ol type="1"><li><p>Open the <span class="guimenu">Printers</span> -folder.</p></li><li><p>Right-click on the printer (<span class="emphasis"><em>remoteprinter on -cupshost</em></span>) and select in the context menu -<span class="guimenuitem">Properties</span></p></li><li><p>Click on the <span class="guilabel">General</span> -tab</p></li><li><p>Click on the button <span class="guibutton">Printing -Preferences...</span></p></li><li><p>A new dialog opens. Keep this dialog open and go back -to the parent dialog.</p></li></ol></div><p> -</p></li><li><p>The third, the "correct" way: (should you do -this from the beginning, just carry out steps 1. and 2. from second -"way" above) - -</p><div class="orderedlist"><ol type="1"><li><p>Click on the <span class="guilabel">Advanced</span> -tab. (Hmmm... if everything is "Grayed Out", then you are not logged -in as a user with enough privileges).</p></li><li><p>Click on the <span class="guibutton">Printing -Defaults...</span> button.</p></li><li><p>On any of the two new tabs, click on the -<span class="guilabel">Advanced...</span> button.</p></li><li><p>A new dialog opens. Compare this one to the other, -identical looking one from "B.5" or A.3".</p></li></ol></div><p> -</p></li></ol></div><p> - -Do you see any difference in the two settings dialogs? I don't -either. However, only the last one, which you arrived at with steps -C.1.-6. will permanently save any settings which will then become the -defaults for new users. If you want all clients to have the same -defaults, you need to conduct these steps as administrator -(<a class="indexterm" name="id2921360"></a><i class="parameter"><tt>printer admin</tt></i> in ) -<span class="emphasis"><em>before</em></span> a client downloads the driver (the clients -can later set their own <span class="emphasis"><em>per-user defaults</em></span> by -following the procedures <span class="emphasis"><em>A.</em></span> -or <span class="emphasis"><em>B.</em></span> above...). (This is new: Windows 2000 and -Windows XP allow <span class="emphasis"><em>per-user</em></span> default settings and -the ones the administrator gives them, before they set up their own). -The "parents" of the identically looking dialogs have a slight -difference in their window names: one is called -<tt class="computeroutput">Default Print Values for Printer Foo on Server -Bar"</tt> (which is the one you need) and the other is -called "<tt class="computeroutput">Print Settings for Printer Foo on Server -Bar</tt>". The last one is the one you arrive at when you -right-click on the printer and select <span class="guimenuitem">Print -Settings...</span>. This is the one what you were -taught to use back in the days of Windows NT! So it is only natural to -try the same way with Win2k or WinXP. You wouldn't dream -that there is now a different "clicking path" to arrive at an -identically looking, but functionally different dialog to set defaults -for all users! -</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>Try (on Win2000 and WinXP) to run this command (as a user -with the right privileges): +The following list needs periods after the letters and numbers::::::::: +</p><div class="orderedlist"><ol type="A"><li><p>The first “<span class="quote">wrong</span>” way: + </p><div class="orderedlist"><ol type="1"><li><p>Open the <span class="guiicon">Printers</span> folder.</p></li><li><p>Right-click on the printer (<span class="emphasis"><em>remoteprinter on cupshost</em></span>) and + select in context menu <span class="guimenu">Printing Preferences...</span></p></li><li><p>Look at this dialog closely and remember what it looks like.</p></li></ol></div></li><li><p>The second “<span class="quote">wrong</span>” way: + </p><div class="orderedlist"><ol type="1"><li><p>Open the <span class="guimenu">Printers</span> folder.</p></li><li><p>Right-click on the printer (<span class="emphasis"><em>remoteprinter on + cupshost</em></span>) and select in the context menu + <span class="guimenuitem">Properties</span></p></li><li><p>Click on the <span class="guilabel">General</span> + tab</p></li><li><p>Click on the <span class="guibutton">Printing + Preferences...</span></p></li><li><p>A new dialog opens. Keep this dialog open and go back + to the parent dialog.</p></li></ol></div><p> + </p></li><li><p> + The third and correct way: (should you do this from the beginning, just carry out steps 1 + and 2 from the second method above). + </p><div class="orderedlist"><ol type="1"><li><p>Click on the <span class="guilabel">Advanced</span> + tab. (If everything is “<span class="quote">grayed out,</span>” then you are not logged + in as a user with enough privileges).</p></li><li><p>Click on the <span class="guibutton">Printing + Defaults</span> button.</p></li><li><p>On any of the two new tabs, + click on the + <span class="guilabel">Advanced</span> button.</p></li><li><p>A new dialog opens. Compare + this one to the other. Are they + identical looking comparing one from + “<span class="quote">B.5</span>” and one from A.3".</p></li></ol></div></li></ol></div><p> +Do you see any difference in the two settings dialogs? I do not either. However, only the last one, which +you arrived at with steps C.1 through 6 will permanently save any settings which will then become the defaults +for new users. If you want all clients to have the same defaults, you need to conduct these steps as +administrator (<a class="indexterm" name="id2928716"></a><i class="parameter"><tt>printer admin</tt></i> in ) before +a client downloads the driver (the clients can later set their own per-user defaults +by following procedures A or B above). Windows 200x/XP allow per-user default settings and the ones the +administrator gives them, before they set up their own. The parents of the identically-looking dialogs have a slight difference in their window names; one is called <tt class="computeroutput">Default Print +Values for Printer Foo on Server Bar"</tt> (which is the one you need) and the other is called +“<span class="quote"><tt class="computeroutput">Print Settings for Printer Foo on Server Bar</tt></span>”. The last one is the one you +arrive at when you right-click on the printer and select <span class="guimenuitem">Print Settings...</span>. This +is the one that you were taught to use back in the days of Windows NT, so it is only natural to try the +same way with Windows 200x/XP. You would not dream that there is now a different path to arrive at an +identically looking, but functionally different, dialog to set defaults for all users. +</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>Try (on Windows 200x/XP) to run this command (as a user with the right privileges): </p><p><b class="userinput"><tt> rundll32 printui.dll,PrintUIEntry /p /t3 /n\\<i class="replaceable"><tt>SAMBA-SERVER</tt></i>\<i class="replaceable"><tt>printersharename</tt></i> </tt></b></p><p> -to see the tab with the <span class="guilabel">Printing Defaults...</span> -button (the one you need). Also run this command: +To see the tab with the <span class="guilabel">Printing Defaults</span> button (the one you need),also run this command: </p><p><b class="userinput"><tt> rundll32 printui.dll,PrintUIEntry /p /t0 /n\\<i class="replaceable"><tt>SAMBA-SERVER</tt></i>\<i class="replaceable"><tt>printersharename</tt></i> </tt></b></p><p> -to see the tab with the <span class="guilabel">Printing Preferences...</span> -button (the one which doesn't set system-wide defaults). You can -start the commands from inside a DOS box" or from the <span class="guimenu">Start</span> --- <span class="guimenuitem">Run...</span> menu. -</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2921530"></a>Supporting large Numbers of Printers</h3></div></div><div></div></div><p> -One issue that has arisen during the recent development phase of Samba -is the need to support driver downloads for 100's of printers. Using -Windows NT APW here is somewhat awkward (to say the least). If you -don't want to acquire RSS pains from such the printer installation -clicking orgy alone, you need to think about a non-interactive script. +To see the tab with the <span class="guilabel">Printing Preferences</span> +button (the one which does not set system-wide defaults), you can +start the commands from inside a DOS box" or from <span class="guimenu">Start</span> -> <span class="guimenuitem">Run</span>. +</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2928854"></a>Supporting Large Numbers of Printers</h3></div></div><div></div></div><p> +One issue that has arisen during the recent development phase of Samba is the need to support driver +downloads for hunderds of printers. Using Windows NT APW here is somewhat awkward (to say the least). If +you do not want to acquire RSS pains from the printer installation clicking orgy alone, you need +to think about a non-interactive script. </p><p> -If more than one printer is using the same driver, the -<b class="command">rpcclient setdriver</b> command can be used to set the -driver associated with an installed queue. If the driver is uploaded -to <i class="parameter"><tt>[print$]</tt></i> once and registered with the -printing TDBs, it can be used by multiple print queues. In this case -you just need to repeat the <b class="command">setprinter</b> subcommand -of <b class="command">rpcclient</b> for every queue (without the need to -conduct the <b class="command">adddriver</b> again and again). The -following is an example of how this could be accomplished: +If more than one printer is using the same driver, the <b class="command">rpcclient setdriver</b> +command can be used to set the driver associated with an installed queue. If the driver is uploaded to +<i class="parameter"><tt>[print$]</tt></i> once and registered with the printing TDBs, it can be used by +multiple print queues. In this case, you just need to repeat the <b class="command">setprinter</b> subcommand of +<b class="command">rpcclient</b> for every queue (without the need to conduct the <b class="command">adddriver</b> +repeatedly). The following is an example of how this could be accomplished: </p><pre class="screen"> <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient <i class="replaceable"><tt>SAMBA-CUPS</tt></i> -U root%<i class="replaceable"><tt>secret</tt></i> -c 'enumdrivers'</tt></b> cmd = enumdrivers @@ -1644,7 +1411,7 @@ following is an example of how this could be accomplished: Driver Name: [dm9110] Printer Driver Info 1: - Driver Name: [myphantasydrivername] + Driver Name: [mydrivername] [....] </pre><p> @@ -1661,7 +1428,7 @@ following is an example of how this could be accomplished: </p><pre class="screen"> <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient <i class="replaceable"><tt>SAMBA-CUPS</tt></i> -U root%<i class="replaceable"><tt>secret</tt></i> -c \ - 'setdriver <i class="replaceable"><tt>dm9110</tt></i> "<i class="replaceable"><tt>Heidelberg Digimaster 9110 (PS)</tt></i>"'</tt></b> + 'setdriver <i class="replaceable"><tt>dm9110</tt></i> "<i class="replaceable"><tt>Heidelberg Digimaster 9110 (PS)</tt></i>"'</tt></b> cmd = setdriver dm9110 Heidelberg Digimaster 9110 (PPD) Successfully set dm9110 to driver Heidelberg Digimaster 9110 (PS). </pre><p> @@ -1678,9 +1445,9 @@ following is an example of how this could be accomplished: </pre><p> </p><pre class="screen"> -<tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient <i class="replaceable"><tt>SAMBA-CUPS</tt></i> -U root%<i class="replaceable"><tt>secret</tt></i> -c 'setdriver <i class="replaceable"><tt>dm9110</tt></i> <i class="replaceable"><tt>myphantasydrivername</tt></i>'</tt></b> - cmd = setdriver dm9110 myphantasydrivername - Successfully set dm9110 to myphantasydrivername. +<tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient <i class="replaceable"><tt>SAMBA-CUPS</tt></i> -U root%<i class="replaceable"><tt>secret</tt></i> -c 'setdriver <i class="replaceable"><tt>dm9110</tt></i> <i class="replaceable"><tt>mydrivername</tt></i>'</tt></b> + cmd = setdriver dm9110 mydrivername + Successfully set dm9110 to mydrivername. </pre><p> </p><pre class="screen"> @@ -1688,119 +1455,94 @@ following is an example of how this could be accomplished: cmd = enumprinters flags:[0x800000] name:[\\SAMBA-CUPS\dm9110] - description:[\\SAMBA-CUPS\dm9110,myphantasydrivername,\ + description:[\\SAMBA-CUPS\dm9110,mydrivername,\ 110ppm HiVolume DANKA Stuttgart] comment:[110ppm HiVolume DANKA Stuttgart] [....] </pre><p> -It may be not easy to recognize: but the first call to -<b class="command">enumprinters</b> showed the "dm9110" printer with an -empty string where the driver should have been listed (between the 2 -commas in the "description" field). After the -<b class="command">setdriver</b> command succeeded, all is well. (The -CUPS Printing chapter has more info about the installation of printer -drivers with the help of <b class="command">rpcclient</b>). -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2921841"></a>Adding new Printers with the Windows NT APW</h3></div></div><div></div></div><p> -By default, Samba exhibits all printer shares defined in -<tt class="filename">smb.conf</tt> in the -<span class="guiicon">Printers...</span> folder. Also located in this folder -is the Windows NT Add Printer Wizard icon. The APW will be shown only -if: -</p><div class="itemizedlist"><ul type="disc"><li><p>...the connected user is able to successfully execute -an <b class="command">OpenPrinterEx(\\server)</b> with administrative -privileges (i.e. root or <a class="indexterm" name="id2921887"></a><i class="parameter"><tt>printer admin</tt></i>). -</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p> Try this from a Windows 2K/XP DOS box command prompt: -</p><p><b class="userinput"><tt> -runas /netonly /user:root rundll32 printui.dll,PrintUIEntry /p /t0 /n \\<i class="replaceable"><tt>SAMBA-SERVER</tt></i>\<i class="replaceable"><tt>printersharename</tt></i> -</tt></b></p><p> -and click on <span class="guibutton">Printing Preferences...</span> -</p></div></li><li><p>... contains the setting -<a class="indexterm" name="id2921942"></a><i class="parameter"><tt>show add printer wizard</tt></i> = yes (the -default).</p></li></ul></div><p> +It may not be easy to recognize that the first call to <b class="command">enumprinters</b> showed the +“<span class="quote">dm9110</span>” printer with an empty string where the driver should have been listed (between +the 2 commas in the description field). After the <b class="command">setdriver</b> command +succeeded, all is well. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2929151"></a>Adding New Printers with the Windows NT APW</h3></div></div><div></div></div><p> +By default, Samba exhibits all printer shares defined in <tt class="filename">smb.conf</tt> in the <span class="guiicon">Printers</span> +folder. Also located in this folder is the Windows NT Add Printer Wizard icon. The APW will be shown only if: +</p><div class="itemizedlist"><ul type="disc"><li><p> + The connected user is able to successfully execute an <b class="command">OpenPrinterEx(\\server)</b> with + administrative privileges (i.e., root or <a class="indexterm" name="id2929197"></a><i class="parameter"><tt>printer admin</tt></i>). + </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p> Try this from a Windows 200x/XP DOS box command prompt: + </p><p><b class="userinput"><tt> + runas /netonly /user:root rundll32 printui.dll,PrintUIEntry /p /t0 /n \\<i class="replaceable"><tt>SAMBA-SERVER</tt></i>\<i class="replaceable"><tt>printersharename</tt></i> + </tt></b></p><p> + Click on <span class="guibutton">Printing Preferences</span>. + </p></div></li><li><p>... contains the setting + <a class="indexterm" name="id2929252"></a><i class="parameter"><tt>show add printer wizard</tt></i> = yes (the + default).</p></li></ul></div><p> The APW can do various things: -</p><div class="itemizedlist"><ul type="disc"><li><p>upload a new driver to the Samba -<i class="parameter"><tt>[print$]</tt></i> share;</p></li><li><p>associate an uploaded driver with an existing (but -still "driverless") print queue;</p></li><li><p>exchange the currently used driver for an existing -print queue with one that has been uploaded before;</p></li><li><p>add an entirely new printer to the Samba host (only in -conjunction with a working <a class="indexterm" name="id2922001"></a><i class="parameter"><tt>add printer command</tt></i>; -a corresponding <a class="indexterm" name="id2922017"></a><i class="parameter"><tt>delete printer command</tt></i> for -removing entries from the <span class="guiicon">Printers...</span> folder -may be provided too)</p></li></ul></div><p> -The last one (add a new printer) requires more effort than the -previous ones. In order to use the APW to successfully add a printer -to a Samba server, the <a class="indexterm" name="id2922045"></a><i class="parameter"><tt>add printer command</tt></i> must -have a defined value. The program hook must successfully add the -printer to the UNIX print system (i.e. to -<tt class="filename">/etc/printcap</tt>, -<tt class="filename">/etc/cups/printers.conf</tt> or other appropriate -files) and to if necessary. +</p><div class="itemizedlist"><ul type="disc"><li><p> + Upload a new driver to the Samba <i class="parameter"><tt>[print$]</tt></i> share. + </p></li><li><p> + Associate an uploaded driver with an existing (but still driverless) print queue. + </p></li><li><p> + Exchange the currently used driver for an existing print queue with one that has been uploaded before. + </p></li><li><p> + Add an entirely new printer to the Samba host (only in conjunction with a working + <a class="indexterm" name="id2929308"></a><i class="parameter"><tt>add printer command</tt></i>. A corresponding + <a class="indexterm" name="id2929324"></a><i class="parameter"><tt>delete printer command</tt></i> for removing entries from the + <span class="guiicon">Printers</span> folder may also be provided). + </p></li></ul></div><p> +The last one (add a new printer) requires more effort than the previous ones. To use +the APW to successfully add a printer to a Samba server, the <a class="indexterm" name="id2929353"></a><i class="parameter"><tt>add printer command</tt></i> must have a defined value. The program hook must successfully +add the printer to the UNIX print system (i.e., to <tt class="filename">/etc/printcap</tt>, +<tt class="filename">/etc/cups/printers.conf</tt> or other appropriate files) and to <tt class="filename">smb.conf</tt> if necessary. </p><p> -When using the APW from a client, if the named printer share does not -exist, smbd will execute the <i class="parameter"><tt>add printer -command</tt></i> and reparse to the -to attempt to locate the new printer share. If the share is still not -defined, an error of <span class="errorname">Access Denied</span> is -returned to the client. Note that the <a class="indexterm" name="id2922095"></a><i class="parameter"><tt>add printer command</tt></i> is executed under the context of the connected -user, not necessarily a root account. A <a class="indexterm" name="id2922111"></a><i class="parameter"><tt>map to guest</tt></i> = bad user may have connected you unwittingly under the wrong -privilege; you should check it by using the -<b class="command">smbstatus</b> command. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2922136"></a>Weird Error Message <span class="errorname">Cannot connect under a -different Name</span></h3></div></div><div></div></div><p> -Once you are connected with the wrong credentials, there is no means -to reverse the situation other than to close all Explorer windows, and -perhaps reboot. -</p><div class="itemizedlist"><ul type="disc"><li><p>The <b class="command">net use \\SAMBA-SERVER\sharename -/user:root</b> gives you an error message: <tt class="computeroutput">Multiple -connections to a server or a shared resource by the same user -utilizing the several user names are not allowed. Disconnect all -previous connections to the server, resp. the shared resource, and try -again.</tt></p></li><li><p>Every attempt to "connect a network drive" to -<tt class="filename">\\SAMBASERVER\\print$</tt> to z: is countered by the -pertinacious message. <tt class="computeroutput">This network folder is currently -connected under different credentials (username and password). -Disconnect first any existing connection to this network share in -order to connect again under a different username and -password</tt>.</p></li></ul></div><p> -So you close all connections. You try again. You get the same -message. You check from the Samba side, using -<b class="command">smbstatus</b>. Yes, there are some more -connections. You kill them all. The client still gives you the same -error message. You watch the smbd.log file on a very high debug level -and try re-connect. Same error message, but not a single line in the -log. You start to wonder if there was a connection attempt at all. You -run ethereal and tcpdump while you try to connect. Result: not a -single byte goes on the wire. Windows still gives the error -message. You close all Explorer Windows and start it again. You try to -connect - and this times it works! Windows seems to cache connection -info somewhere and doesn't keep it up to date (if you are unlucky you -might need to reboot to get rid of the error message). -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2922236"></a>Be careful when assembling Driver Files</h3></div></div><div></div></div><p> -You need to be very careful when you take notes about the files and -belonging to a particular driver. Don't confuse the files for driver -version "0" (for Win95/98/ME, going into -<tt class="filename">[print$]/WIN/0/</tt>), driver version "2" (Kernel Mode -driver for WinNT, going into <tt class="filename">[print$]/W32X86/2/</tt> -<span class="emphasis"><em>may</em></span> be used on Win2K/XP too), and driver version -"3" (non-Kernel Mode driver going into -<tt class="filename">[print$]/W32X86/3/</tt> <span class="emphasis"><em>can not</em></span> -be used on WinNT). Very often these different driver versions contain -files carrying the same name; but still the files are very different! -Also, if you look at them from the Windows Explorer (they reside in -<tt class="filename">%WINDOWS%\system32\spool\drivers\W32X86\</tt>) you -will probably see names in capital letters, while an "enumdrivers" -command from Samba would show mixed or lower case letters. So it is -easy to confuse them. If you install them manually using -<b class="command">rpcclient</b> and subcommands, you may even succeed -without an error message. Only later, when you try install on a -client, you will encounter error messages like <tt class="computeroutput">This -server has no appropriate driver for the printer</tt>. +When using the APW from a client, if the named printer share does not exist, smbd will execute the +<a class="indexterm" name="id2929396"></a><i class="parameter"><tt>add printer command</tt></i> and reparse to the to attempt to locate the new printer +share. If the share is still not defined, an error of <span class="errorname">Access Denied</span> is returned to +the client. The <a class="indexterm" name="id2929418"></a><i class="parameter"><tt>add printer command</tt></i> is executed +under the context of the connected user, not necessarily a root account. A <a class="indexterm" name="id2929433"></a><i class="parameter"><tt>map to guest</tt></i> = bad user may have connected you unwittingly under the wrong +privilege. You should check it by using the <b class="command">smbstatus</b> command. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2929458"></a>Error Message: “<span class="quote"><span class="errorname">Cannot connect under a different Name</span></span>”</h3></div></div><div></div></div><p> +Once you are connected with the wrong credentials, there is no means to reverse the situation other than +to close all Explorer Windows, and perhaps reboot. +</p><div class="itemizedlist"><ul type="disc"><li><p> + The <b class="command">net use \\SAMBA-SERVER\sharename /user:root</b> gives you an error message: + “<span class="quote">Multiple connections to a server or a shared resource by the same user utilizing + the several user names are not allowed. Disconnect all previous connections to the server, + resp. the shared resource, and try again.</span>” + </p></li><li><p> + Every attempt to “<span class="quote">connect a network drive</span>” to <tt class="filename">\\SAMBASERVER\\print$</tt> + to <tt class="constant">z:</tt> is countered by the pertinacious message: “<span class="quote">This + network folder is currently connected under different credentials (username and password). + Disconnect first any existing connection to this network share in order to connect again under + a different username and password</span>”. + </p></li></ul></div><p> +So you close all connections. You try again. You get the same message. You check from the Samba side, +using <b class="command">smbstatus</b>. Yes, there are more connections. You kill them all. The client +still gives you the same error message. You watch the smbd.log file on a high debug level and try +reconnect. Same error message, but not a single line in the log. You start to wonder if there was a +connection attempt at all. You run ethereal and tcpdump while you try to connect. Result: not a single +byte goes on the wire. Windows still gives the error message. You close all Explorer windows and start it +again. You try to connect and this times it works! Windows seems to cache connection informtion somewhere and +does not keep it up-to-date (if you are unlucky you might need to reboot to get rid of the error message). +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2929564"></a>Take Care When Assembling Driver Files</h3></div></div><div></div></div><p> +You need to be extremely careful when you take notes about the files and belonging to a particular +driver. Don't confuse the files for driver version “<span class="quote">0</span>” (for Windows 9x/Me, going into +<tt class="filename">[print$]/WIN/0/</tt>), driver version <tt class="filename">2</tt> (Kernel Mode driver for Windows NT, +going into <tt class="filename">[print$]/W32X86/2/</tt> may be used on Windows 200x/XP also), and +driver version “<span class="quote">3</span>” (non-Kernel Mode driver going into <tt class="filename">[print$]/W32X86/3/</tt> +cannot be used on Windows NT). Quite often these different driver versions contain +files that have the same name but actually are very different. If you look at them from +the Windows Explorer (they reside in <tt class="filename">%WINDOWS%\system32\spool\drivers\W32X86\</tt>), +you will probably see names in capital letters, while an <b class="command">enumdrivers</b> command from Samba +would show mixed or lower case letters. So it is easy to confuse them. If you install them manually using +<b class="command">rpcclient</b> and subcommands, you may even succeed without an error message. Only later, +when you try install on a client, you will encounter error messages like <tt class="computeroutput">This server +has no appropriate driver for the printer</tt>. </p><p> -Here is an example. You are invited to look very closely at the -various files, compare their names and their spelling, and discover -the differences in the composition of the version-2 and -3 sets -Note: the version-0 set contained 40 (!) -<i class="parameter"><tt>Dependentfiles</tt></i>, so I left it out for space -reasons: +Here is an example. You are invited to look closely at the various files, compare their names and +their spelling, and discover the differences in the composition of the version 2 and 3 sets. Note: the +version 0 set contained 40 <i class="parameter"><tt>Dependentfiles</tt></i>, so I left it out for space reasons: </p><pre class="screen"> <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -U 'Administrator%<i class="replaceable"><tt>secret</tt></i>' -c 'enumdrivers 3' 10.160.50.8 </tt></b> @@ -1860,7 +1602,7 @@ reasons: Defaultdatatype: [] </pre><p> -If we write the "version 2" files and the "version 3" files +If we write the “<span class="quote">version 2</span>” files and the “<span class="quote">version 3</span>” files into different text files and compare the result, we see this picture: </p><pre class="screen"> @@ -1892,13 +1634,14 @@ picture: > cns3ggr.dll </pre><p> -Don't be fooled though! Driver files for each version with identical + +Do not be fooled! Driver files for each version with identical names may be different in their content, as you can see from this size comparison: </p><pre class="screen"> <tt class="prompt">root# </tt><b class="userinput"><tt>for i in cns3g.hlp cns3gui.dll cns3g.dll; do \ smbclient //10.160.50.8/print\$ -U 'Administrator%xxxx' \ - -c "cd W32X86/3; dir $i; cd .. ; cd 2; dir $i"; \ + -c "cd W32X86/3; dir $i; cd .. ; cd 2; dir $i"; \ done</tt></b> CNS3G.HLP A 122981 Thu May 30 02:31:00 2002 @@ -1909,248 +1652,213 @@ comparison: CNS3G.DLL A 1145088 Thu May 30 02:31:00 2002 CNS3G.DLL A 15872 Thu May 30 02:31:00 2002 - </pre><p> -In my example were even more differences than shown here. Conclusion: -you must be very careful to select the correct driver files for each -driver version. Don't rely on the names alone. Don't interchange files +In my example were even more differences than shown here. Conclusion: you must be careful to select +the correct driver files for each driver version. Don't rely on the +names alone and don't interchange files belonging to different driver versions. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2922594"></a>Samba and Printer Ports</h3></div></div><div></div></div><p> -Windows NT/2000 print servers associate a port with each -printer. These normally take the form of <tt class="filename">LPT1:</tt>, -<tt class="filename">COM1:</tt>, <tt class="filename">FILE:</tt>, etc. Samba -must also support the concept of ports associated with a printer. By -default, only one printer port, named "Samba Printer Port", exists on -a system. Samba does not really need such a "port" in order to print; -it rather is a requirement of Windows clients. They insist on being -told about an available port when they request this info, otherwise -they throw an error message at you. So Samba fakes the port +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2929923"></a>Samba and Printer Ports</h3></div></div><div></div></div><p> +Windows NT/2000 print servers associate a port with each printer. These normally take the form of +<tt class="filename">LPT1:</tt>, <tt class="filename">COM1:</tt>, +<tt class="filename">FILE:</tt>, and so on. Samba must also +support the concept of ports associated with a printer. By default, only one printer port, named “<span class="quote">Samba +Printer Port</span>”, exists on a system. Samba does not really need such a “<span class="quote">port</span>” in order +to print; rather it is a requirement of Windows clients. They insist on being told about an available +port when they request this information, otherwise they throw an error message at you. So Samba fakes the port information to keep the Windows clients happy. </p><p> -Note that Samba does not support the concept of "Printer Pooling" -internally either. Printer Pooling assigns a logical printer to -multiple ports as a form of load balancing or fail over. +Samba does not support the concept of <tt class="constant">Printer Pooling</tt> internally either. Printer +Pooling assigns a logical printer to multiple ports as a form of load balancing or fail over. </p><p> -If you require that multiple ports be defined for some reason or -another (“<span class="quote">My users and my Boss should not know that they are -working with Samba</span>”), possesses a -<a class="indexterm" name="id2922668"></a><i class="parameter"><tt>enumports command</tt></i> which can be used to define -an external program that generates a listing of ports on a system. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2922687"></a>Avoiding the most common Misconfigurations of the Client Driver</h3></div></div><div></div></div><p> -So - printing works, but there are still problems. Most jobs print -well, some don't print at all. Some jobs have problems with fonts, -which don't look good at all. Some jobs print fast, and some are -dead-slow. We can't cover it all; but we want to encourage you to read -the little paragraph about "Avoiding the wrong PostScript Driver -Settings" in the CUPS Printing part of this document. -</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2922712"></a>The Imprints Toolset</h2></div></div><div></div></div><p> -The Imprints tool set provides a UNIX equivalent of the -Windows NT Add Printer Wizard. For complete information, please -refer to the Imprints web site -at <a href="http://imprints.sourceforge.net/" target="_top">http://imprints.sourceforge.net/</a> -as well as the documentation included with the imprints source -distribution. This section will only provide a brief introduction -to the features of Imprints. -</p><p><b>Attention! Maintainer required. </b> -Unfortunately, the Imprints toolset is no longer maintained. As of -December, 2000, the project is in need of a new maintainer. The most -important skill to have is decent perl coding and an interest in -MS-RPC based printing using Samba. If you wish to volunteer, please -coordinate your efforts on the samba-technical mailing list. The -toolset is still in usable form; but only for a series of older -printer models, where there are prepared packages to use. Packages for -more up to date print devices are needed if Imprints should have a -future.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2922768"></a>What is Imprints?</h3></div></div><div></div></div><p> +If you require multiple ports be defined for some reason or another (my users and my boss should not know +that they are working with Samba), configure <a class="indexterm" name="id2929988"></a><i class="parameter"><tt>enumports command</tt></i> +which can be used to define an external program that generates a listing of ports on a system. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2930008"></a>Avoiding Common Client Driver Misconfiguration</h3></div></div><div></div></div><p> +So now the printing works, but there are still problems. Most jobs print well, some do not print at +all. Some jobs have problems with fonts, which do not look good. Some jobs print fast and some +are dead-slow. We cannot cover it all, but we want to encourage you to read the brief paragraph about +“<span class="quote">Avoiding the Wrong PostScript Driver Settings</span>” in the CUPS Printing part of this document. +</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2930033"></a>The Imprints Toolset</h2></div></div><div></div></div><p> +The Imprints tool set provides a UNIX equivalent of the Windows NT Add Printer +Wizard. For complete information, please refer to the Imprints Web site at <ulink url="http://imprints.sourceforge.net/">http://imprints.sourceforge.net/</ulink> as well as the documentation +included with the imprints source distribution. This section only provides a brief introduction to +the features of Imprints. +</p><p> +Unfortunately, the Imprints toolset is no longer maintained. As of December 2000, the project is in +need of a new maintainer. The most important skill to have is Perl coding and an interest in MS-RPC-based +printing used in Samba. If you wish to volunteer, please coordinate +your efforts on the Samba technical +mailing list. The toolset is still in usable form, but only for a series of older printer models where +there are prepared packages to use. Packages for more up-to-date print devices are needed if Imprints +should have a future. +</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2930071"></a>What is Imprints?</h3></div></div><div></div></div><p> Imprints is a collection of tools for supporting these goals: -</p><div class="itemizedlist"><ul type="disc"><li><p>Providing a central repository information regarding -Windows NT and 95/98 printer driver packages</p></li><li><p>Providing the tools necessary for creating the -Imprints printer driver packages.</p></li><li><p>Providing an installation client which will obtain -printer drivers from a central internet (or intranet) Imprints Server -repository and install them on remote Samba and Windows NT4 print -servers.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2922810"></a>Creating Printer Driver Packages</h3></div></div><div></div></div><p> -The process of creating printer driver packages is beyond the scope of -this document (refer to Imprints.txt also included with the Samba -distribution for more information). In short, an Imprints driver -package is a gzipped tarball containing the driver files, related INF -files, and a control file needed by the installation client. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2922828"></a>The Imprints Server</h3></div></div><div></div></div><p> -The Imprints server is really a database server that may be queried -via standard HTTP mechanisms. Each printer entry in the database has -an associated URL for the actual downloading of the package. Each +</p><div class="itemizedlist"><ul type="disc"><li><p> + Providing a central repository of information regarding Windows NT and 95/98 printer driver packages. + </p></li><li><p> + Providing the tools necessary for creating the Imprints printer driver packages. + </p></li><li><p> + Providing an installation client that will obtain printer drivers from a central Internet (or intranet) Imprints Server + repository and install them on remote Samba and Windows NT4 print servers. + </p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2930113"></a>Creating Printer Driver Packages</h3></div></div><div></div></div><p> +The process of creating printer driver packages is beyond the scope of this document (refer to Imprints.txt +also included with the Samba distribution for more information). In short, an Imprints driver package +is a gzipped tarball containing the driver files, related INF files, and a control file needed by the +installation client. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2930132"></a>The Imprints Server</h3></div></div><div></div></div><p> +The Imprints server is really a database server that may be queried via standard HTTP mechanisms. Each +printer entry in the database has an associated URL for the actual downloading of the package. Each package is digitally signed via GnuPG which can be used to verify that -package downloaded is actually the one referred in the Imprints -database. It is strongly recommended that this security check -<span class="emphasis"><em>not</em></span> be disabled. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2922853"></a>The Installation Client</h3></div></div><div></div></div><p> -More information regarding the Imprints installation client is -available in the <tt class="filename">Imprints-Client-HOWTO.ps</tt> file -included with the imprints source package. -</p><p> -The Imprints installation client comes in two forms. -</p><div class="itemizedlist"><ul type="disc"><li><p>a set of command line Perl scripts</p></li><li><p>a GTK+ based graphical interface to the command line Perl -scripts</p></li></ul></div><p> -The installation client (in both forms) provides a means of querying -the Imprints database server for a matching list of known printer -model names as well as a means to download and install the drivers on +the package downloaded is actually +the one referred in the Imprints database. It is strongly recommended that this security check +not be disabled. +</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2930153"></a>The Installation Client</h3></div></div><div></div></div><p> +More information regarding the Imprints installation client is available from the the documentation file +<tt class="filename">Imprints-Client-HOWTO.ps</tt> that is included with the Imprints source package. The Imprints +installation client comes in two forms: +</p><div class="itemizedlist"><ul type="disc"><li><p>A set of command line Perl scripts.</p></li><li><p>A GTK+ based graphical interface to the command line Perl scripts.</p></li></ul></div><p> +The installation client (in both forms) provides a means of querying the Imprints database server for +a matching list of known printer model names as well as a means to download and install the drivers on remote Samba and Windows NT print servers. </p><p> -The basic installation process is in four steps and perl code is -wrapped around smbclient and rpcclient +The basic installation process is in four steps and Perl code is wrapped around smbclient and rpcclient. </p><div class="itemizedlist"><ul type="disc"><li><p> - foreach (supported architecture for a given driver) - </p><div class="orderedlist"><ol type="1"><li><p>rpcclient: Get the appropriate upload directory on the remote server</p></li><li><p>smbclient: Upload the driver files</p></li><li><p>rpcclient: Issues an AddPrinterDriver() MS-RPC</p></li></ol></div><p> - </p></li><li><p>rpcclient: Issue an AddPrinterEx() MS-RPC to actually create the printer</p></li></ul></div><p> -One of the problems encountered when implementing the Imprints tool -set was the name space issues between various supported client -architectures. For example, Windows NT includes a driver named "Apple -LaserWriter II NTX v51.8" and Windows 95 calls its version of this -driver "Apple LaserWriter II NTX" + For each supported architecture for a given driver: + </p><div class="orderedlist"><ol type="1"><li><p>rpcclient: Get the appropriate upload directory on the remote server.</p></li><li><p>smbclient: Upload the driver files.</p></li><li><p>rpcclient: Issues an AddPrinterDriver() MS-RPC.</p></li></ol></div><p> + </p></li><li><p>rpcclient: Issue an AddPrinterEx() MS-RPC to actually create the printer.</p></li></ul></div><p> +One of the problems encountered when implementing the Imprints tool set was the name space issues between +various supported client architectures. For example, Windows NT includes a driver named “<span class="quote">Apple LaserWriter +II NTX v51.8</span>” and Windows 95 calls its version of this driver “<span class="quote">Apple LaserWriter II NTX</span>”. </p><p> -The problem is how to know what client drivers have been uploaded for -a printer. An astute reader will remember that the Windows NT Printer -Properties dialog only includes space for one printer driver name. A -quick look in the Windows NT 4.0 system registry at +The problem is how to know what client drivers have been uploaded for a printer. An astute reader will +remember that the Windows NT Printer Properties dialog only includes space for one printer driver name. A +quick look in the Windows NT 4.0 system registry at: </p><p><tt class="filename"> HKLM\System\CurrentControlSet\Control\Print\Environment </tt></p><p> -will reveal that Windows NT always uses the NT driver name. This is -ok as Windows NT always requires that at least the Windows NT version -of the printer driver is present. However, Samba does not have the -requirement internally. Therefore, how can you use the NT driver name -if is has not already been installed? -</p><p> -The way of sidestepping this limitation is to require that all -Imprints printer driver packages include both the Intel Windows NT and -95/98 printer drivers and that NT driver is installed first. -</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2923008"></a>Add Network Printers at Logon without User Interaction</h2></div></div><div></div></div><p> -The following MS Knowledge Base article may be of some help if you -need to handle Windows 2000 clients: <span class="emphasis"><em>How to Add Printers -with No User Interaction in Windows 2000.</em></span> ( <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;189105" target="_top">http://support.microsoft.com/default.aspx?scid=kb;en-us;189105</a> -). It also applies to Windows XP Professional clients. +will reveal that Windows NT always uses the NT driver name. This is okay as Windows NT always requires +that at least the Windows NT version of the printer driver is present. Samba does not have the +requirement internally, therefore, “<span class="quote">How can you use the NT driver name if it has not already been installed?</span>” </p><p> -The ideas sketched out below are inspired by this article. It -describes a commandline method which can be applied to install -network and local printers and their drivers. This is most useful -if integrated in Logon Scripts. You can see what options are -available by typing in a command prompt ("DOS box") this: +The way of sidestepping this limitation is to require that all Imprints printer driver packages include both the Intel Windows NT and +95/98 printer drivers and that the NT driver is installed first. +</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2930314"></a>Adding Network Printers without User Interaction</h2></div></div><div></div></div><p> +The following MS Knowledge Base article may be of some help if you need to handle Windows 2000 +clients: <span class="emphasis"><em>How to Add Printers with No User Interaction in Windows 2000,</em></span> (<ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;189105">http://support.microsoft.com/default.aspx?scid=kb;en-us;189105</ulink>). +It also applies to Windows XP Professional clients. +The ideas sketched out in this section are inspired by this article, which describes a commandline method that can be +applied to install network and local printers and their drivers. This is most useful if integrated in Logon +Scripts. You can see what options are available by typing in the command prompt (<b class="command">DOS box</b>): </p><p><b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /?</tt></b></p><p> -A window pops up which shows you all of the commandline switches -available. An extensive list of examples is also provided. This is -only for Win 2k/XP. It doesn't work on WinNT. WinNT has probably some -other tools in the respective Resource Kit. Here is a suggestion about -what a client logon script might contain, with a short explanation of -what the lines actually do (it works if 2k/XP Windows clients access -printers via Samba, but works for Windows-based print servers too): +A window pops up that shows you all of the commandline switches available. An extensive list of examples +is also provided. This is only for Win 200x/XP, it does not work on +Windows NT. Windows NT probably has +some other tools in the respective Resource Kit. Here is a suggestion about what a client logon script +might contain, with a short explanation of what the lines actually do (it works if 200x/XP Windows +clients access printers via Samba, and works for Windows-based print servers too): </p><pre class="screen"> -<b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /dn /n "\\sambacupsserver\infotec2105-IPDS" /q</tt></b> -<b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /in /n "\\sambacupsserver\infotec2105-PS"</tt></b> -<b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /y /n "\\sambacupsserver\infotec2105-PS"</tt></b> +<b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /dn /n "\\cupsserver\infotec2105-IPDS" /q</tt></b> +<b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /in /n "\\cupsserver\infotec2105-PS"</tt></b> +<b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /y /n "\\cupsserver\infotec2105-PS"</tt></b> </pre><p> Here is a list of the used commandline parameters: -</p><div class="variablelist"><dl><dt><span class="term">/dn</span></dt><dd><p>deletes a network printer</p></dd><dt><span class="term">/q</span></dt><dd><p>quiet modus</p></dd><dt><span class="term">/n</span></dt><dd><p>names a printer</p></dd><dt><span class="term">/in</span></dt><dd><p>adds a network printer connection</p></dd><dt><span class="term">/y</span></dt><dd><p>sets printer as default printer</p></dd></dl></div><div class="itemizedlist"><ul type="disc"><li><p>Line 1 deletes a possibly existing previous network -printer <span class="emphasis"><em>infotec2105-IPDS</em></span> (which had used native -Windows drivers with LPRng that were removed from the server which was -converted to CUPS). The <b class="command">/q</b> at the end eliminates -"Confirm" or error dialog boxes popping up. They should not be -presented to the user logging on.</p></li><li><p>Line 2 adds the new printer -<span class="emphasis"><em>infotec2105-PS</em></span> (which actually is same physical -device but is now run by the new CUPS printing system and associated -with the CUPS/Adobe PS drivers). The printer and its driver -<span class="emphasis"><em>must</em></span> have been added to Samba prior to the user -logging in (e.g. by a procedure as discussed earlier in this chapter, -or by running <b class="command">cupsaddsmb</b>). The driver is now -auto-downloaded to the client PC where the user is about to log -in.</p></li><li><p>Line 3 sets the default printer to this new network -printer (there might be several other printers installed with this -same method and some may be local as well -- so we decide for a -default printer). The default printer selection may of course be -different for different users.</p></li></ul></div><p> -Note that the second line only works if the printer -<span class="emphasis"><em>infotec2105-PS</em></span> has an already working print queue -on "sambacupsserver", and if the printer drivers have successfully been -uploaded (via <b class="command">APW</b> , -<b class="command">smbclient/rpcclient</b> or -<b class="command">cupsaddsmb</b>) into the -<i class="parameter"><tt>[print$]</tt></i> driver repository of Samba. Also, some -Samba versions prior to version 3.0 required a re-start of smbd after -the printer install and the driver upload, otherwise the script (or -any other client driver download) would fail. +</p><div class="variablelist"><dl><dt><span class="term">/dn</span></dt><dd><p>deletes a network printer</p></dd><dt><span class="term">/q</span></dt><dd><p>quiet modus</p></dd><dt><span class="term">/n</span></dt><dd><p>names a printer</p></dd><dt><span class="term">/in</span></dt><dd><p>adds a network printer connection</p></dd><dt><span class="term">/y</span></dt><dd><p>sets printer as default printer</p></dd></dl></div><div class="itemizedlist"><ul type="disc"><li><p> + Line 1 deletes a possibly existing previous network printer <span class="emphasis"><em>infotec2105-IPDS</em></span> + (which had used native Windows drivers with LPRng that were removed from the server that was + converted to CUPS). The <b class="command">/q</b> at the end eliminates Confirm + or error dialog boxes from popping up. They should not be presented to the user logging on. + </p></li><li><p> + Line 2 adds the new printer + <span class="emphasis"><em>infotec2105-PS</em></span> (which actually is the same + physical device but is now run by the new CUPS printing system and associated with the + CUPS/Adobe PS drivers). The printer and its driver must have been added to Samba prior to + the user logging in (e.g., by a procedure as discussed earlier in this chapter, or by running + <b class="command">cupsaddsmb</b>). The driver is now auto-downloaded to the client PC where the + user is about to log in. + </p></li><li><p> + Line 3 sets the default printer to this new network printer (there might be several other + printers installed with this same method and some may be local as well, so we decide for a + default printer). The default printer selection may, of course, be different for different users. + </p></li></ul></div><p> +The second line only works if the printer <span class="emphasis"><em>infotec2105-PS</em></span> has an already working +print queue on the <tt class="constant">cupsserver</tt>, and if the +printer drivers have been successfully uploaded +(via the <b class="command">APW</b>, <b class="command">smbclient/rpcclient</b>, or <b class="command">cupsaddsmb</b>) +into the <i class="parameter"><tt>[print$]</tt></i> driver repository of Samba. Some Samba versions +prior to version 3.0 required a re-start of smbd after the printer install and the driver upload, +otherwise the script (or any other client driver download) would fail. </p><p> -Since there no easy way to test for the existence of an installed -network printer from the logon script, the suggestion is: don't bother -checking and just allow the deinstallation/reinstallation to occur -every time a user logs in; it's really quick anyway (1 to 2 seconds). +Since there no easy way to test for the existence of an installed network printer from the logon script, +do not bother checking, just allow the deinstallation/reinstallation to occur every time a user logs in; +it's really quick anyway (1 to 2 seconds). </p><p> The additional benefits for this are: -</p><div class="itemizedlist"><ul type="disc"><li><p>It puts in place any printer default setup changes -automatically at every user logon.</p></li><li><p>It allows for "roaming" users' login into the domain from -different workstations.</p></li></ul></div><p> -Since network printers are installed per user this much simplifies the -process of keeping the installation up-to-date. The extra few seconds -at logon time will not really be noticeable. Printers can be centrally -added, changed, and deleted at will on the server with no user -intervention required on the clients (you just need to keep the logon -scripts up to date). -</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2923342"></a>The <b class="command">addprinter</b> command</h2></div></div><div></div></div><p> -The <b class="command">addprinter</b> command can be configured to be a -shell script or program executed by Samba. It is triggered by running -the APW from a client against the Samba print server. The APW asks the -user to fill in several fields (such as printer name, driver to be -used, comment, port monitor, etc.). These parameters are passed on to -Samba by the APW. If the addprinter command is designed in a way that -it can create a new printer (through writing correct printcap entries -on legacy systems, or execute the <b class="command">lpadmin</b> command -on more modern systems) and create the associated share in -, then the APW will in effect really -create a new printer on Samba and the UNIX print subsystem! -</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2923388"></a>Migration of "Classical" printing to Samba</h2></div></div><div></div></div><p> -The basic "NT-style" printer driver management has not changed -considerably in 3.0 over the 2.2.x releases (apart from many small -improvements). Here migration should be quite easy, especially if you -followed previous advice to stop using deprecated parameters in your -setup. For migrations from an existing 2.0.x setup, or if you -continued "Win9x-style" printing in your Samba 2.2 installations, it -is more of an effort. Please read the appropriate release notes and -the HOWTO Collection for 2.2. You can follow several paths. Here are -possible scenarios for migration: -</p><div class="itemizedlist"><ul type="disc"><li><p>You need to study and apply the new Windows NT printer -and driver support. Previously used parameters <i class="parameter"><tt>printer -driver file</tt></i>, <i class="parameter"><tt>printer driver</tt></i> and -<i class="parameter"><tt>printer driver location</tt></i> are no longer -supported.</p></li><li><p>If you want to take advantage of WinNT printer driver -support you also need to migrate the Win9x/ME drivers to the new -setup.</p></li><li><p>An existing <tt class="filename">printers.def</tt> file - (the one specified in the now removed parameter <i class="parameter"><tt>printer driver file</tt></i>) will work no longer with samba 3. In -3.0, smbd attempts to locate a Win9x/ME driver files for the printer -in <i class="parameter"><tt>[print$]</tt></i> and additional settings in the TDB -and only there; if it fails it will <span class="emphasis"><em>not</em></span> (as 2.2.x -used to do) drop down to using a <tt class="filename">printers.def</tt> -(and all associated parameters). The make_printerdef tool is removed -and there is no backwards compatibility for this.</p></li><li><p>You need to install a Windows 9x driver into the -<i class="parameter"><tt>[print$]</tt></i> share for a printer on your Samba -host. The driver files will be stored in the "WIN40/0" subdirectory of -<i class="parameter"><tt>[print$]</tt></i>, and some other settings and info go -into the printing-related TDBs.</p></li><li><p>If you want to migrate an existing -<tt class="filename">printers.def</tt> file into the new setup, the current -only solution is to use the Windows NT APW to install the NT drivers -and the 9x drivers. This can be scripted using smbclient and -rpcclient. See the Imprints installation client at: -</p><p> - <a href="http://imprints.sourceforge.net/" target="_top">http://imprints.sourceforge.net/</a> -</p><p> -for an example. See also the discussion of rpcclient usage in the -"CUPS Printing" section.</p></li></ul></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2923561"></a>Publishing Printer Information in Active Directory or LDAP</h2></div></div><div></div></div><p> -We will publish an update to this section shortly. -</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2923575"></a>Common Errors</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2923582"></a>I give my root password but I don't get access</h3></div></div><div></div></div><p> -Don't confuse the root password which is valid for the UNIX system -(and in most cases stored in the form of a one-way hash in a file -named <tt class="filename">/etc/shadow</tt>) with the password used to -authenticate against Samba!. Samba doesn't know the UNIX password; for -root to access Samba resources via Samba-type access, a Samba account -for root must be created first. This is often done with the -<b class="command">smbpasswd</b> command. -</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2923615"></a>My printjobs get spooled into the spooling directory, but then get lost</h3></div></div><div></div></div><p> -Don't use the existing UNIX print system spool directory for the Samba -spool directory. It may seem convenient and a saving of space, but it -only leads to problems. The two <span class="emphasis"><em>must</em></span> be separate. -</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="msdfs.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="optional.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="CUPS-printing.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 17. Hosting a Microsoft Distributed File System tree on Samba </td><td width="20%" align="center"><a accesskey="h" href="samba-doc.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 19. CUPS Printing Support in Samba 3.0</td></tr></table></div></body></html> +</p><div class="itemizedlist"><ul type="disc"><li><p> + It puts in place any printer default setup changes automatically at every user logon. + </p></li><li><p> + It allows for “<span class="quote">roaming</span>” users' login into the domain from different workstations. + </p></li></ul></div><p> +Since network printers are installed per user, this much simplifies the process of keeping the installation +up-to-date. The few extra seconds at logon time will not really be noticeable. Printers can be centrally +added, changed and deleted at will on the server with no user intervention required from the clients +(you just need to keep the logon scripts up-to-date). +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2930639"></a>The <b class="command">addprinter</b> Command</h2></div></div><div></div></div><p> +The <b class="command">addprinter</b> command can be configured to be a shell script or program executed by +Samba. It is triggered by running the APW from a client against the Samba print server. The APW asks +the user to fill in several fields (such as printer name, driver to be used, comment, port monitor, +and so on). These parameters are passed on to Samba by the APW. If the addprinter command is designed in a +way that it can create a new printer (through writing correct printcap entries on legacy systems, or +execute the <b class="command">lpadmin</b> command on more modern systems) and create the associated share +in, then the APW will in effect really create a new printer on Samba and the UNIX print subsystem! +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2930686"></a>Migration of Classical Printing to Samba</h2></div></div><div></div></div><p> +The basic NT-style printer driver management has not changed considerably in 3.0 over the 2.2.x releases +(apart from many small improvements). Here migration should be quite easy, especially if you followed +previous advice to stop using deprecated parameters in your setup. For migrations from an existing 2.0.x +setup, or if you continued Windows 9x/Me-style printing in your Samba 2.2 installations, it is more of +an effort. Please read the appropriate release notes and the HOWTO Collection for Samba-2.2.x. You can +follow several paths. Here are possible scenarios for migration: +</p><div class="itemizedlist"><ul type="disc"><li><p> + You need to study and apply the new Windows NT printer and driver support. Previously used + parameters <i class="parameter"><tt>printer driver file</tt></i>, <i class="parameter"><tt>printer driver</tt></i> + and <i class="parameter"><tt>printer driver location</tt></i> are no longer supported. + </p></li><li><p> + If you want to take advantage of Windows NT printer driver support, you also need to migrate the + Windows 9x/Me drivers to the new setup. + </p></li><li><p> + An existing <tt class="filename">printers.def</tt> file (the one specified in the now removed parameter + <i class="parameter"><tt>printer driver file</tt></i>) will no longer work with Samba-3. In 3.0, smbd attempts + to locate a Windows 9x/Me driver files for the printer in <i class="parameter"><tt>[print$]</tt></i> + and additional settings in the TDB and only there; if it fails, it will <span class="emphasis"><em>not</em></span> + (as 2.2.x used to do) drop down to using a <tt class="filename">printers.def</tt> (and all associated + parameters). The make_printerdef tool is removed and there is no backward compatibility for this. + </p></li><li><p>You need to install a Windows 9x/Me driver into the + <i class="parameter"><tt>[print$]</tt></i> share for a printer on your Samba + host. The driver files will be stored in the “<span class="quote">WIN40/0</span>” subdirectory of + <i class="parameter"><tt>[print$]</tt></i>, and some other settings and information go + into the printing-related TDBs.</p></li><li><p>If you want to migrate an existing + <tt class="filename">printers.def</tt> file into the new setup, the + only current + solution is to use the Windows NT APW to install the NT drivers + and the 9x/Me drivers. This can be scripted using smbclient and + rpcclient. See the Imprints installation client at: + </p><p> + <ulink url="http://imprints.sourceforge.net/">http://imprints.sourceforge.net/</ulink> + </p><p> + for an example. See also the discussion of rpcclient usage in the + “<span class="quote">CUPS Printing</span>” section.</p></li></ul></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2930861"></a>Publishing Printer Information in Active Directory or LDAP</h2></div></div><div></div></div><p> +This will be addressed in a later update of this document. If you wish to volunteer your services to help +document this, please contact <ulink url="mail://jht@samba.org">John H Terpstra.</ulink> +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2930884"></a>Common Errors</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2930892"></a>I Give My Root Password but I Do Not Get Access</h3></div></div><div></div></div><p> +Do not confuse the root password which is valid for the UNIX system (and in most cases stored in the +form of a one-way hash in a file named <tt class="filename">/etc/shadow</tt>), with the password used to +authenticate against Samba. Samba does not know the UNIX password. Root access to Samba resources +requires that a Samba account for root must first be created. This is done with the <b class="command">smbpasswd</b> +command as follows: +</p><pre class="screen"> +<tt class="prompt">root# </tt> smbpasswd -a root +New SMB password: secret +Retype new SMB password: secret +</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2930943"></a>My Print Jobs Get Spooled into the Spooling Directory, but Then Get Lost</h3></div></div><div></div></div><p> +Do not use the existing UNIX print system spool directory for the Samba spool directory. It may seem +convenient and a savings of space, but it only leads to problems. The two must be separate. +</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="msdfs.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="optional.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="CUPS-printing.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 17. Hosting a Microsoft Distributed File System tree on Samba </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 19. CUPS Printing Support</td></tr></table></div></body></html> |