System Administration Guide: Printing

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

This procedure shows how to use LP print commands to add a local print queue with the localhost option specified as the host name in the print system databases. Note that you can also modify a configured print queue to use localhost as the host name.

  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 5–3 Adding a Print Queue With localhost Specified 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 5–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 5–5 Modifying a Print Queue to Use localhost as the Host 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 Add a Print Queue With localhost Specified as the Host Name (Solaris Print Manager).