This procedure shows how to use LP print commands to add a local print queue with localhost specified as the host name in the print system databases. This modification was added to enable print servers to maintain the same print host name, independent of the machine host name. Note that you can also modify a print queue by using these commands.
Become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Set the print host name to localhost.
# lpadmin -p new-print-queue -s localhost -v device |
Check the entry in the /etc/printers.conf file.
% lpget new-print-queue new-print-queue: bsdaddr=abc,new-print-queue,Solaris |
If the print queue was created or modified successfully, the output of the lpget command returns the name of the new or modified print queue.
This example shows how to add a new print queue, paper, by using the lpadmin command with the -s option to specify localhost as the host name.
% su - root # lpadmin -p paper -s localhost -v /dev/ecpp0 % lpget paper paper: bsdaddr=localhost,paper,Solaris |
This example shows the default behavior of the lpadmin command for using system host name, abc, when adding a new print queue.
% su - root # lpadmin -p newspaper -v /dev/printers/0 % lpget newspaper fargo: bsdaddr=abc,newspaper,Solaris |
This example shows how to modify an existing print queue, newspaper, and specify localhost as the new print server name.
% su - root # lpadmin -p newspaper -s localhost # lpget newspaper newspaper: bsdaddr=localhost,newspaper,Solaris |
For information about specifying localhost as the print server's host name when adding or modifying a print queue with Solaris Print Manager, see How to Use Solaris Print Manager to Add a Print Queue With the Local Host Specified as the Host Name.