fncreate_printer(1M)
NAME
fncreate_printer − create new printers in the FNS namespace
SYNOPSIS
fncreate_printer [ −sv ] compositename printername printeraddr [ printeraddr ... ]
fncreate_printer [ −sv ] [ −f filename ] compositename
AVAILABILITY
SUNWfnspr
DESCRIPTION
fncreate_printer creates a new printer 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 supports creating a set of printers as listed in the file filename.
The new printer 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 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 denoted by the “leaf” name, this command will create printer(s) for the intermediate node(s) if they do not already exist. See examples below.
fncreate_printer creates NIS+ entries in the NIS+ hierarchy for FNS. See fns(5) for more information on the necessary NIS+ credentials and the use of the environment variable NIS_GROUP when using fncreate and other FNS commands.
OPTIONS
−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 printers as they are created.
−f filename Use filename to obtain a list of printers to be created. If this option is omitted, /etc/printers.conf is used as the input file.
OPERANDS
filename The file that contains a list of printers to be created. This file uses the same format as /etc/printers.conf.
printername The name of the new printer created.
printeraddr An address to be associated with the printer name.
compositename The FNS name for the org, host, user, or site object for which the new printers are created.
EXAMPLES
The following examples illustrate creating a set of printers under an organization, a printer for a user, and a printer associated with a hierarchical printer name for a site, respectively.
Example 1
Create printers for an organization:
example% fncreate_printer org/marketing
This causes the creation of a printer for every entry listed in the /etc/printers.conf file on the system where the command is executed. The printers thus created are bound under the organization’s printer context, org/marketing/service/printer.
Example 2
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 printer to be associated with the killtree printer on the server paperwaster, overwriting the existing address, if any, of type bsdaddr.
Example 3
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 name 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.
EXIT STATUS
This command returns 0 on sucess and 1 if it is not successful.
SEE ALSO
cancel(1), lp(1), lpr(1B), lprm(1B), lpq(1B), lpstat(1), fncreate(1M), lpmove(1M), fns(5)
SunOS 5.5.1 — Last change: 22 Sep 1994