|
System Administration Commands | fncreate_printer(1M) |
| fncreate_printer - create new printers in the FNS namespace |
SYNOPSIS
| fncreate_printer [-sv] compositename printername printeraddr [printeraddr ...] |
| fncreate_printer [-sv] [-f filename] compositename |
|
fncreate_printer creates a new printer context for an organization, user, host, or site object. compositename is the FNS name of the object. fncreate_printer uses printername
to name the new printer and binds it to an FNS reference constructed from the set of printeraddrs. fncreate_printer may also
be used to add new printeraddrs for an existing printername.
The command also supports creating a set of printers as listed in the file filename.
The new printer context is created with the FNS name <compositename>/service/printer/<printername>. If the intermediate service or printer names do not exist, their FNS contexts are also created by this command. Normally,
these intermediate contexts would be created by an administrative script that uses fncreate(1M),
and is run at the time a new FNS organization is set up. The reference bound to the FNS printer name is of type onc_printers
and is constructed from the set of printeraddrs. A printeraddr is of the form <addresstype>=<address>. See printers.conf(4) for the
format of printeraddr and also the examples below for currently supported address types and address strings.
An FNS printer name is accepted as a valid printer name by lp(1), lpstat(1), cancel(1), lpmove(1M), lpr(1B), lpq(1B), and lprm(1B).
The printername argument may be a slash-separated name. In this case, prior to creating the printer context denoted by the ``leaf'' name, this command will create printer
context(s) for the intermediate node(s) if they do not already exist. See EXAMPLES.
fncreate_printer creates entries in the naming service determined by fnselect(1M).
See fnselect(1M) for more information on the default naming service and on selecting a
naming service. Furthermore, the process executing the fncreate_printer command may require certain credentials to update information in the underlying namespace. See fns_nis+(5), fns_nis(5), and fns_files(5) for more information.
|
|
- -s
- The new address supersedes an existing address with the same addresstype, if any, for <compositename>/service/printer/<printername>. If this option is omitted, it appends
the printeraddr to an existing reference, or creates a new reference using printeraddr for the printer.
- -v
- Displays information about individual printer contexts as they are created.
- -f filename
- Use filename to obtain a list of printers for which to create contexts. If this
option is omitted, /etc/printers.conf is used as the input file, in which case the -s option should be used to supersede the entries already present in this file.
|
|
-
filename
- The file that contains a list of printers to be created. This file uses the same
format as /etc/printers.conf. See printers.conf(4)
for more information.
-
printername
- The name of the new printer context created.
-
printeraddr
- An address to be associated with the printer context name.
-
compositename
- The FNS name for the org, host, user,
or site object for which the new printer contexts are created.
|
| Example 1. Creating Printer Contexts
|
The following examples illustrate creating a set of printer contexts under an organization, a printer context for a user, and a printer context associated with a hierarchical printer name for a site,
respectively. To create printers for an organization:
|
example% fncreate_printer -s org/marketing
|
This causes the creation of a printer context for every entry listed in the /etc/printers.conf file on the system where the command is executed. The printer contexts thus created are bound under the organization's printer context, org/marketing/service/printer. The -s flag is required to force the creation of the printer contexts in the underlying namespace, since the default /etc/printers.conf file is being used.
To create a printer named ps for user jsmith and associate it with the killtree printer served by the print server paperwaster:
|
example% fncreate_printer -s usr/jsmith ps bsdaddr=paperwaster,killtree
|
This causes jsmith's ps printername to be associated with the killtree
printer on the server paperwaster, overwriting any existing address of type bsdaddr. The user can print to this printer using the command:
|
example% lp -d thisuser/service/printer/ps <filename>
|
To create a printer with the hierarchical name color/fast under a site:
|
example% fncreate_printer site/bldg14/northwing color/fast \
bsdaddr=paperwaster,laser
|
This causes the printer named site/bldg14/northwing/service/printer/color/fast to be associated with the laser printer on server paperwaster. If the intermediate printer context site/bldg14/northwing/service/printer/color does not exist, it will also be created and associated with the same printer. If
the printer name site/bldg14/northwing/service/printer/color/fast already exists and has an address of type bsdaddr associated with it, this command will fail.
|
|
|
-
0
- Successful operation.
-
1
- Operation failed.
|
|
See attributes(5) for descriptions of the following
attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Availability | SUNWfns |
|
|
cancel(1), lp(1), lpq(1B), lpr(1B), lprm(1B), lpstat(1), fncreate(1M), fnselect(1M), lpmove(1M), printers(4), printers.conf(4), attributes(5), fns(5), fns_files(5), fns_nis(5), fns_nis+(5)
|
| |