Administering the Printer Namespace
9
- This chapter describes the administration of the printer namespace. The printer context is not part of the XFN policies. It is provided in FNS in order to store printer bindings.
The Printer Namespace
- FNS provides the capability to store printer bindings in the FNS namespace. This gives print servers the means to advertise their services and allow users to browse and choose amongst the available printers without client side administration.
- Printer bindings are stored in printer contexts, which are associated with organizations, users, hosts, and sites. Hence, each organization, user, host, and site has its own printer context.
- The printer context is created under the service context of the respective composite name. For example, the composite name shown below has the following printer context:
-
org/wiz.com./service/printer
|
- The name of a printer for a host, labpc, with a printer context might look like this:
-
host/labpc/service/printer/laser
|
Administering Printer Contexts
- Currently, printer contexts are supported for name service of files, NIS, and NIS+. The manner in which the bindings are stored in the printer context varies according to the underlying name service used for implementing FNS. For NIS and files, printer bindings are only associated with organizations and all the bindings exist in one printer context. NIS+, however, stores the printer bindings in the printer context, which allows the printer namespace to be arranged hierarchically and be associated with the org, host, user, and site contexts.
Using Files
- Files are used as the default name service if neither NIS nor NIS+ is present. The printer bindings are stored in the /etc/printers.conf file, which is the printer configuration database used to describe printers. Each printer binding requires its own entry in this file. For example, if you have a printer named printer1, with the alias ps, you would add an entry to the printers.conf file in this format:
-
printer1|ps:bsdaddr=server_name,printer_name
|
- In this example, when a lookup is performed on and address containing printer1, the address type of onc_printers_bsdaddr is returned. For more information about the required file format in printers.conf, see the printers.conf(4) man page.
Using NIS
- If NIS is the underlying name service, the NIS map that is used to store the printer configuration is called printers.conf.byname. Each printer binding has an entry in this file. For example, if you have a printer named printer2, with the alias lp, you would add an entry to the printers.conf.byname file in this format:
-
printer2|lp:bsdaddr=server_name,printer_name
|
- For more information about the syntax required, see the printers.conf.byname(4) man page.
- When you list or look up the available printers (using lpstat(1), fnlist(3N) or fn_ctx_lookup() for example), the results are created by merging the list of printers included in the files name service (/etc/printers.conf) with the list of printers included in the NIS name service map
-
-
(/etc/printers.conf.byname).
Using NIS+
- If NIS+ is the underlying name service for FNS, administering printer contexts is simplified by the fncreate_printer command, which creates the printer context for organization, users, hosts, and sites.
- The fncreate_printer command takes the following arguments:
-
fncreate_printer composite_name printer_name printer_address
|
- where printer_address is in the form addresstype=address. In the next example, the printer_address is bsdaddr=labpc,laser-jet. For more information, see the fncreate_printer(1) man page.
- In this example, a printer binding for the printer laser-jet for the user jsmith is created:.
-
% fncreate_printer user/jsmith laser-jet bsdaddr=labpc,laser-jet
|
- The new binding, user/jsmith/service/printer/laser-jet, has the address type onc_printers_bsdaddr, and the address labpc,laser-jet. FNS adds the prefix onc_printers_ to the address type.
- In NIS+, it is possible to organize printers hierarchically. For example, printers can be listed under the printer context, as shown by the following commands:
-
% fncreate_printer org/wiz.com. color/lpq bsdaddr=colorful,lpq
% fncreate_printer org/wiz.com. color/laser bsdaddr=colorprt,laser
% fncreate_printer org/wiz.com. color/inkj bsdaddr=colorjet,inkj
|
- The fncreate command added the printer bindings for the printers, lpq, laser, and inkj to the context color present under the printer context. The result looks like this:
-
org/wiz.com./service/printer/color/lpq
org/wiz.com./service/printer/color/laser
org/wiz.com./service/printer/color/inkj
|
- Similarly, color printers, green, red, and blue for user jsmith can be organized as follows:
-
user/jsmith/service/printer/color/green
user/jsmith/service/printer/color/red
user/jsmith/service/printer/color/blue
|
- Printer bindings (contexts) in NIS+ can be removed using the fndestroy command. For example, to remove the printer context in this example, use the command:
-
% fndestroy user/jsmith/service/printer/laser-jet
|
- When you list or look up the available printers (using lpstat(1), fnlist(3N) or fn_ctx_lookup() for example), the results are created by merging the list of printers included in the files name service (/etc/printers.conf) with the list of printers included in the NIS+ tables generated by fncreate(1) or fncreate_printer(1).
|