|
Sams Teach Yourself Samba in 24 Hours |
|||||||||||||||||
|
Hour 8: Printers |
|||||||||||||||||
|
If you had to create a new printer share every time you added a new printer to your Samba server, administration of the Samba server could become complicated. To simplify life, Samba provides a scheme for printers similar to the [homes] share described in Hour 7. Briefly, when a client requests a connection to a share, Samba uses the following approach:
1. Searches for a share in the smb.conf; if found, returns the share.
2. If not found but a [homes] section is present, looks for a user in the passwd file with the same name as the requested share. If found, returns that as a share.
3. If still not found but a [printers] section exists, searches for a printer with the same name as the requested share and returns it as a share.
4. If still not found, looks for the default service, and if present, returns that as a share.
5. If still not found, returns an error indicating that the network name is not present.
The [printers] share looks like any other printer share. In fact, you can turn this one into a [printers] share:
[printers]
comment = All printers on this machine, got from printcap
path = /var/spool/samba
printable = yes
When Samba uses the [printers] share because the requested share does not exist as a section and does not resolve as a [homes] share, the [printers] share is cloned and given the name of the requested share and printer name. This means that all such printers defined by the [printers] section take their parameters from the [printers] section.
Where does Samba get the list of printers? From the printcap file. If your system is based on BSD for printing or uses PLP or LPRNG, you have a printcap file in /etc/printcap. However, if your system uses System V printing, you can make a printcap file, or use the printcap name parameter as shown later in this chapter.
|
Sams Teach Yourself Samba in 24 Hours |
|||||||||||||||||
|
Hour 8: Printers |
|||||||||||||||||
|
© Copyright Macmillan USA. All rights reserved.