xref: /illumos-gate/usr/src/man/man8/lpset.8 (revision ab1dc24c)
te
Copyright (C) 2003, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
LPSET 8 "March 12, 2023"
NAME
lpset - set printing configuration in /etc/printers.conf or other supported databases
SYNOPSIS
lpset [-n system | fnsldap] [-x]
 [ [-D binddn] [-w passwd] [-h ldaphost]]
 [-a key=value] [-d key] destination
DESCRIPTION
The lpset utility sets printing configuration information in the system configuration databases. Use lpset to create and update printing configuration in /etc/printers.conf. See nsswitch.conf(5) and printers.conf(5).

Only a superuser or a member of Group 14 may execute lpset.

OPTIONS
The following options are supported: -n system|ldap

Create or update the configuration information for the destination entry in /etc/printers.conf or LDAP printer contexts. system specifies that the information is created or updated in /etc/printers.conf. ldap specifies that the information is written to an LDAP server. If -n is not specified, system is the default.

-x

Remove all configuration for the destination entry from the database specified by the -n option.

-a key=value

Configure the specified key=value pair for the destination. See printers.conf(5) for information regarding the specification of key=value pairs.

-d key

Delete the configuration option specified by key for the destination entry. See printers.conf(5) for information regarding the specification of key and key=value pairs.

-D binddn

Use the distinguished name (DN) binddn to bind to the LDAP directory server.

-w passwd

Use passwd as the password for authentication to the LDAP directory server.

-h ldaphost

Specify an alternate host on which the LDAP server is running. This option is only used when ldap is specified as the naming service. If this option is not specified, the default is the current host system.

OPERANDS
The following operand is supported: destination

Specifies the entry in /etc/printers.conf or LDAP, in which to create or modify information. destination names a printer of class of printers. See lpadmin(8). Each entry in printers.conf describes one destination. Specify destination using atomic names. POSIX-style destination names are not acceptable. See printers.conf(5) for information regarding the naming conventions for atomic names and standards(7) for information regarding POSIX.

EXAMPLES
Example 1 Removing All Existing Printing Configuration Information

The following example removes all existing printing configuration information for destination dogs from /etc/printers.conf:

example% lpset -x dogs

Example 2 Setting a key=value Pair in LDAP

example% lpset -n ldap -h ldapl.example.com -D "cn=Directory Manager" \e
 -w passwd -a key1=value1 printer1
EXIT STATUS
The following exit values are returned: 0

Successful completion.

non-zero

An error occurred.

FILES
/etc/printers.conf

System configuration database.

ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE
Stability Level Stable
SEE ALSO
ldap (1), lp (1), lpstat (1), lpc (1B), lpq (1B), lpr (1B), nsswitch.conf (5), printers (5), printers.conf (5), attributes (7), standards (7), ldapclient (8), lpadmin (8), lpget (8)

NOTES
If the ldap database is used, the printer administrator should be mindful of the following when updating printer information.

1. Because the domain information for the printer being updated is extracted from the ldapclient(8) configuration, the LDAP server being updated must host the same domain that is used by the current ldapclient(8) server.

2. If the LDAP server being updated is a replica LDAP server, the updates will be referred to the master LDAP server and completed there. The updates might be out of sync and not appear immediately, as the replica server may not have been updated by the master server. For example, a printer that you deleted by using lpset may still appear in the printer list you display with lpget until the replica is updated from the master. Replica servers vary as to how often they are updated from the master. See System Administration Guide: Solaris Printing for information on LDAP server replication.

3. Although users can use the LDAP command line utilities ldapadd(1) and ldapmodify(1) to update printer entries in the directory, the preferred method is to use lpset. Otherwise, if the ldapadd and ldapmodify utilities are used, the administrator must ensure that the printer-name attribute value is unique within the ou=printers container on the LDAP server. If the value is not unique, the result of modifications done using lpset may be unpredictable.