System Administration Guide: Solaris Printing

ProcedureHow to Use LP Print Commands to Add a Print Queue With localhost Specified as the Host Name

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.

  1. 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.

  2. Set the print host name to localhost.


    # lpadmin -p new-print-queue -s localhost -v device
    
  3. 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.


Example 4–3 Adding a Print Queue by Specifying localhost as the Host Name

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


Example 4–4 Adding a Print Queue by Using the Default Behavior of lpadmin to Specify the Host Name

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


Example 4–5 Modifying a Print Queue to Use the Local Host as the Print Server Name

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

See Also

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.