LPD.CONF(5)
β¨ NAME β¨
lpd.conf β the configuration file for the LPRng line printer spooler system, bestie. This is the manual page, LPD.CONF(5), filed under File Formats Manual, and it's literally the glow-up guide for your whole print setup. π
πΈ DESCRIPTION πΈ
okay so here's the tea: the file lpd.conf is what you use to hand over configuration info to the LPRng Printer spooler system, and it also sets the defaults for printcap information. π
The parsing rules are giving very chill, very forgiving:
- Leading spaces on lines? Ignored, we don't care. π«Ά
- Blank lines? Ignored. π€
- Lines whose first nonblank character is a sharp (
#)? Also ignored, that's a comment bestie. π
Trailing blanks and tabs (whitespace) on an option value get deleted β UNLESS the last one is escaped with a backslash (\). Then it stays. π
Every other line specifies parameters, and it should look like one of these:
keyword
keyword@
keyword#value
keyword=value
Not me reminding you that these values are the same format as printcap(5) values. iykyk. β¨
So here's the cute part: values in the configuration can contain host or machine dependent information. To help with that, these escape sequences in the configuration information get replaced like so:
%hβ the short form of the host name (i.e. non fully qualified). π¦%Hβ the fully qualified host name. π%aβ the abbreviated architecture name, likesun4,sol2,hpux,aix,irix5, etc. This value can be set using thearchitecturekeyword in the configuration file, and it's set to a default value at compile_time. β%Pβ the printer name from the printcap entry (see below). π%Rβ the remote printer name from the printcap entry. π%Mβ the remote host name from the printcap entry. This is truncated to the short host name. πΈ
For example, on host dickory.sdsu.edu, the strings short=%h long=%H arch=%a would be expanded as short=dickory long=dickory.sdsu.edu arch=sun4 . no cap. π
The P, R, and M tags are provided for use with combined configuration and printcap information. But heads up: these values are not expanded when the printcap information is initially processed, and can be used only in a limited number of printcap or other entries. Currently only the printcap :sd: (spool directory) and :forward_server: (forward server) entries use these. π«Ά
π GENERAL CONFIGURATION PARAMETERS π
Some of the following parameters take lists of files or directories. Unless otherwise explicitly stated, these lists can be separated by commas (,), semicolons (;), or colons, (punctuation) and possibly tabs or spaces (whitespace) as well. mix and match, she's flexible. π¦
Keyword names can use either underscores (_) or hyphens (-) in their names, but the underscore is preferred. periodt. π
include pathname [pathname*](no default) β This can be used to include files into thelpd.conffile. The include file parameter a whitespace separated list of files; the files must have absolute pathnames and must be readable. πae(default:"jobend $H $n $P $k $b $t") β This specifies either a script or a filter to be invoked at the send of a job for accounting purposes. Seeasfor the matching accounting at start, and theprintcap(5)andlpd(8)man pages for details. π§Ύallow_getenv(default:"LPD_CONF") β This option specifies an environment variable whose value is a configuration file. Use of this is restricted to test purposes, and SUID ROOT client and server will not run when the variable is enabled. so like, don't. πar(default:yes) β Seeprintcap(5)for details. β¨architectureβ The default value is set at compile time and can be overwritten with this parameter. The default value of this parameter is set at compile time and it is used when expanding the special sequence%ain pathname and filename strings in this config file. ποΈauth(default:NULL) β Authentication type to be used for client to server communication. πauth_client_filter(default:NULL) β Program to be used for client to server communication. π«Άauth_forward(default:NULL) β Authentication type to be used for server to server communication. πauth_forward_filter(default:NULL) β Program to be used for server to server communication. π‘auth_forward_id(default:NULL) β Authentication id of remote server for server to server communication. πauth_receive_filter(default:NULL) β Program to be used by server receive server or client communication. π¬auth_server_id(default:NULL) β Authentication id of originating client or server. πͺͺas(default:"jobstart $H $n $P $k $b $t") β Seeas. πbk(default:no) β Seeprintcap(5)for details. πbk_filter_options(default:"$P $w $l $x $y $F $c $L $i $J $C $0n $0h $-a") β If the"bkf"(backwards compatible filter) flags is set in the printcap entry and the original filter specification does not have a`$`in it, this option string is appended to a filter specification, and the string expanded with values from the printcap information and job information. (seeof_filter_options,filter_options,bk_filter_options,bk_of_filter_options) π₯bk_of_filter_options(default:"$w $l $x $y") β If the"bkf"(backwards compatible filter) flags is set in the printcap entry and the original filter specification does not have a`$`in it, this option string is appended to theOFfilter specification, and the string expanded with values from the printcap information and job information. (seeof_filter_options,filter_options,bk_filter_options,bk_of_filter_options) π«check_for_nonprintable(default:"") β (Used by LPR) checkfandpformats for non_printable characters unless-b(binary) or-l(literal) command_line option is supplied. Note that files containing HPGL or other printer control languages would often be classed as ``non_printable''. πconnect_grace(default:0 seconds) β The time to pause before opening a new connection to a printer. This allows the printer time to recover from the previous job. give her a sec, she's resting. πconnect_interval(default:10 (seconds)) β The time to pause after a failed connection or open of the printing device before attempting a new connection or open. πconnect_timeout(default:10 (seconds)) β The time to wait for a device open or connection to complete. A zero value is infinite timeout. β³retry_nolink(default:true) β WhenTRUEand the LPD server is printing or transferring a job, then an indefinite number of attempts to connect to or open the IO device will be made. she does NOT give up, main character energy. πͺdefault_banner_printer(default:"") β The default banner printer program to be used for printing banners. This should be specified in the LPD configuration file. πdefault_format(default:"f") β Default format for printing jobs. πdefault_logger_port(default:2001) β specifies a default port number for logger information. Seelogger_destinationfor details. πdefault_logger_protocol(default:UDP) β specifies a default protocol for logger information. Seelogger_destinationfor details. π‘default_permission(default:ACCEPT) β Default permission for operations. βdefault_printer(default:"") β The default printer to use if there is noPRINTERenvironment variable, the user has not specified a printer, or there is no printcap information. π¨οΈdefault_priority(default:"A") β Default priority (class) for printing jobs. This is also used as the job class. βdefault_remote_host(default:"%H") β The default remote host to use. πdefault_tmp_dir(default:/tmp) β Directory for temporary files. πdomain_name(default:"") β This parameter is optional, and is appended to the hostname to make it into a fully_qualified domain name, ie.class.iona.ie. It will only be used if the software cannot determine the domain name using other means, such asgethostbyname(3n). πff(default:\f) β Formfeed string. πfilter_ld_path(default: ) β The value for the environment variableLD_LIBRARY_PATH, both used when executing, and passed on to filters. This variable is used to find shared libraries on SunOS, Solaris and Linux. π§filter_options(default:"$C $F $H $J $L $P $Q $R $Z $a $c $d $e $f $h $i $j $k $l $n $p $r $s $w $x $y $-a") β If the"bkf"(backwards compatible filter) flags is not set in the printcap entry and the original filter specification does not have a`$`in it, this option string is appended to a filter specification, and the string expanded with values from the printcap information and job information. (seeof_filter_options,filter_options,bk_filter_options,bk_of_filter_options) πfilter_path(default:/bin:/usr/bin:/usr/local/bin) β The value for the environment variablePATH, both used to find filters and passed on to filters run bylpdandlpr. π£οΈforce_poll(default:no) β Some software packages put print jobs directly into the spool queues. Theforce_pollflag forceslpdto periodically poll spool queues looking for jobs and no server. Thepoll_timevariable sets the interval between polls. π΅οΈfull_time(default:no) β Use full time and date format in logging and error messages. π°οΈfx(default:"") β Seeprintcap(5)for details. This specifies the job formats allowed for this queue. π―group(default"daemon") β The group to use for file ownership and process permissions. Used only bylpd; this can be the name of a group or a number. All filters will run as the specified group. Note that if thegroupvalue is0, then the real user group of the process at startup will be used. π₯kerberos_keytab(default"/etc/lpd.keytab") β The keytab file to be used by the LPD server when using built-in kerberos authentication. The keytab file should be owned by the LPD server, and be readable/writable only by it (i.e. -600permissions). πkerberos_life(defaultNULL) β The lifetime of a Kerberos ticket.NULLselects the default lifetime. Time should be specified using the standard Kerberos time representations. β±οΈkerberos_forward_principal(defaultNULL) β remote principal used by server when forwarding πkerberos_renew(defaultNULL) β The renewal of a Kerberos ticket.NULLselects a non-renewable ticket. Time should be specified using the standard Kerberos time representations. β»οΈkerberos_server_principal(default"lpr") β Server principal used when client sending to server or when server is originating connection to another server for forwarding. πkerberos_service(default"lpr") β bestie, this is the service name you use when you're making requests to the LPD server with kerberos auth. Like, saykerberos_serviceis set tolpr, the server lives on hostalpha.com, and your kerberos domain isALPHA.COMβ then the kerberos principal name would be:
lpr/alpha.com@ALPHA.COM
la(default:yes) β seeprintcap(5)for the deets.lf(default:log) β the name of the log file. that's it, that's the whole vibe.lo(default:lock) β the name of the lock file.localhost(default"localhost") β the name of the localhost entry used for the TCP/IP loopback interface. The TCP/IP connection may originate from the local host, so use this name to check whether the local host address is in the IP address database, and use it as the origination address for local connections. Why?? because it avoids problems with multi-homed hosts that originate connections from different interfaces. πlockfile(default:/var/spool/lpd/lpd) β this is the file that signals "hey, an lpd server is running on this host". Thelpd_portvalue gets appended to thelockfilevalue so you get a unique lockfile even when different versions of LPRng are running on the same system. no collision drama here π«Άlogger_destination(default:"") β this specifies where logger info generated by the lpd server goes. The destination spec is built likehost[%port][,(TCP|UDP)]. For example,localhost%2001,UDPwould send logger information to the localhost IP address, on port 2001 using the UPD protocol. The default port and protocol come from thedefault_logger_portanddefault_logger_protocolconfiguration variables respectively.longnumber(default:no) β RFC1179 requires 3 digit job numbers; settinglongnumbertoyesallows 6 digit numbers. If thebackwards_compatibleflag is set, only 3 digit numbers will be used.lpd_listen_port(default:=off)[ipaddr%]portβ the port that lpd binds to. If the parameter is set tooffthen lpd does not listen to any TCP port. Seelpd_portfor the details of the format of the argument.
If this is not set at all, then lpdP will listen on lpd_port.
lpd_port(default:printer)[ipaddr%]portβ the port that lpr and the other client programs send their requests to. The spec has the formatipaddr%port. If the IP address is specified then a bind to only this address and port is done. If the port value is not a number a service lookup is performed and the corresponding service port is used; seeservices(5). This parameter is lowkey iconic for debugging a new installation of LPRng, because running LPRng on a different port from the default will not interfere with a previous installation of LPD or LPRng. πlpd_printcap_path(default:"") β the location of lpd server only printcap database information. If this is nonblank theprintcap_pathPwill not be used by the lpd server.mail_operator_on_error(default:"") β put this person on the CC-list of the mail, but only if it is not a success mail. (So in addition to the person who made the printer request, this person also gets error messages, but no success messages. imagine.)max_status_line(default:79) β an integer value specifying the number of characters used for displaying simple job status; this includes the queue position, job identifier, job contents, size, and time. A0(zero) value indicates no restrictions.max_status_size(default:10(Kbytes)) β an integer value specifying (in K bytes) the maximum size of the status file generated during printing operations. A0value will create unlimited size status files. When the file size exceeds this value, it is truncated tomin_status_sizeK bytes.mc(default:1) β seeprintcap(5)for details.min_status_size(default:0(Kbytes)) β minimum status size. If0, defaults to 20 percent ofmax_status_size.minfree(default:0) β the amount of free space (in Kbytes) needed in the spool directory for a job to even be accepted. If0, there is no limit; if the parameter is the name of a file rather than a number, the file must contain a numerical minimum free value (in Kbytes). This value is overridden by the printcapmifield value.ms_time_resolution(default:FALSE) β this flag causes the time information to be printed to millisecond accuracy. fr fr this is overkill for most purposes. πof_filter_options(default:"") β if this is not set, the value defaults to the same as thefilter_optionsvalue. This string is appended to aOFfilter specification, and the string is expanded with values from the printcap information and job information. If the"bkf"(backwards compatible filter) flags is set in the printcap entry, thebk_of_filter_optionsvalue is appended instead (seeof_filter_options,filter_options,bk_filter_options,bk_of_filter_options).originate_port(default:"721 731") β a range of port numbers to originate requests from. When sending service requests, the software will try to open and bind to these ports to originate a request to a server. If no port is given, or all of the requested ports are unavailable or cannot be bound to, then a normal use port is requested. Heads up: on UNIX systems, if a port in the range0-1023is requested the EUID of the process must be root for the request to be granted. Also note that RFC1179 specifies that requests must originate from ports in the range721-731.pass_env(default:"LANG,LC_CTYPE,LC_NUMERIC,LC_TIME,LC_COLLATE,LC_MONETARY,LC_MESSAGES,LC_PAPER,LC_NAME,LC_ADDRESS,LC_TELEPHONE,LC_MEASUREMENT,LC_IDENTIFICATION,LC_ALL") β client programs such as LPR, LPC, etc., will pass these environment variables to any filter programs they start. π¦poll_time(default:6000) β interval in seconds at which LPD checks for queues with jobs and no server active. Seeforce_pollas well.pl(default:66) β seeprintcap(5)for details.pr(default:/bin/pr) β seeprintcap(5)for details.printcap_path(default:"/etc/printcap") β the location of the printcap database file. If a file or filter does not exist, it is considered a fatal error. All valid entries in these files will be used. See PRINTCAP LOOKUP for details.perms_path(default:/etc/lpd.perms:/usr/etc/lpd.perms:/var/spool/lpd/lpd.perms.%h) β the location of the printer permissions database. If a file or filter does not exist, it is skipped. The first file or filter that exists and is readable will be used. See PERMISSIONS LOOKUP for details.pw(default:80) β seeprintcap(5)for details.save_on_error(default:no) β save a job in the spool queue if it has an error rather than removing it.save_when_done(default:no) β save a job in the spool queue after completion rather than removing it.send_data_first(default:no) β send data files of a job first, followed by the control file.send_failure_action(default:"") β the lpd server uses this to decide what to do when it's unable to print or process a job. The keywordabortwill cause it to terminate operations, leaving the job in the queue,removewill cause it to remove the job,retrywill cause it to retry the job, andholdwill cause it to hold the job with an error indication. If the value is a filter, then the filter will be invoked and the exit status of the filter is used to determine the actions.send_job_rw_timeout(default:6000) β when printing or sending a job to a remote printer, use this as the write to the device or remote host timeout value. If a timeout occurs, then aFAILstatus is returned and thesend_failure_actionvalue is used to determine what to do on failure.send_try(default:3) β number of times to try to send a job to the printer or remote host. A0value means an infinite number of times. πsendmail(default:"/usr/lib/sendmail -oi -t") β if the argument is empty then allmail_relatedfunctionality is disabled. The arguments are the command to run when mail is to be sent. The command used needs to be able to accept the message on stdin, with no arguments. The message will contain theTo:,From:,Cc:andSubject:headers.server_tmp_dir(default:/tmp) β temporary dir for the server.spool_dir_perms(default:042700) β permissions of the spool directories.spool_file_perms(default:0600) β permissions of the spool files.syslog_device(default:/dev/console) β log to this device if all else fails. the backup plan of backup plans πunix_socket_path(default:/var/run/lprng/socket) β location of the Unix socket that lpd listens on and that LPRng clients attempt to communicate to when host is localhost. Set tooffto disable listening and connecting via a Unix socket.use_date(default:no) β no information about this parameter available. (not me telling you there's literally nothing in the docs for this one π )use_identifier(default:no) β add a job identifier line to the control file, using the'A'entry in the control file.use_info_cache(default:yes) β if this is set toyes,lpd.permsand printcap information lookups will be cached for later use. Only lookups in the main databases will be cached, not lookups in the per_printer databases. You can force the lpd to flush its cache and reread the permissions file by sending it aSIGHUP. πuse_queuename(default:no) β put an entry into control files identifying the spool queue the job was originally sent to. The entry has the form'Qspoolname', and its value can be passed to filters. This is useful for setting up a spool queue which formats jobs in different ways, depending on the name of the queue.use_shorthost(default:no) β okay so by default, the names oflprjob files use the originating host's fully qualified domain name, right? And bestie, that can go over 14 characters, which is literally the limit for file names on some UNIX systems π. Set this toyesand it uses the non-qualified name instead β and if the host name is at most 8 characters, your file name stays at most 14 characters long. slay.user(default:daemon) β this is the user thatlpdand its filters run as, and it's also the owner of the spool directories and the otherlpd_writablefiles π«Ά. It can be a user name or a number. And if theuservalue is0, then the real UID of the program when it was started gets used β which is how a non_root user can test out the functionality of the LRPng software β¨.
π PRINTCAP LOOKUP, DATABASE FILES AND FILTERS π
So the printcap_path and printer_perms_path variables specify a list of either data base files or filters to use to get printcap or permission entries for a printer π. To get information, the filter is started and a single line with the printer name is sent to it. And ngl, note that the printer name all is used to request information either about all printers, or about a specific printer entry that has a list of all printers. See printcap(5) for more details π
.
To find the printcap information, LPRng programs will read the database files specified in the printcap_path entry. The lpd server will read any additional files specified in the lpd_printcap_path entry. And here's the part where you gotta pay attention, bestie:
If any of the files is missing or non-readable, a fatal error will result π. No cap.
After having searched the various files, if a filter has been specified, the filter will be started and the required printer name will be sent to the filter. The output from the filter will be used as the printcap information. iconic.
π SECURITY-RELATED PARAMETERS π
Environment variables are sanitized by lpd and the other executables β like, the variables IFS, LD_PRELOAD and LD_PROFILE are all deleted from the environment passed to filters and any other sub_processes π§. For more reliability, script filters should set their own PATH and LD_LIBRARY_PATH variables. fr fr.
All filters will run as the user and group specified by the group and user variables π.
πΈ EXAMPLE πΈ
# lpd.conf generated from on Wed Apr 7 07:59:48 PDT 1999
# The values in this file are the default values.
# If you modify the file, set the value to something other than the default
# For example, '# default force_localhost' means
# the 'force_localhost' option value is on or 1.
# Uncomment this and change it to read 'force_localhost@'
# Purpose: always print banner, ignore lpr -h option
# default ab@
# Purpose: query accounting server when connected
# default achk@
# Purpose: accounting at end (see also af, la, ar, as)
# default ae=jobend $H $n $P $k $b $t
# Purpose: name of accounting file (see also la, ar)
# default af=
af=acct
# Purpose: automatically hold all jobs
# default ah@
ah
# Purpose: Allow duplicate command line arguments (legacy requirement)
# default allow_duplicate_args@
π FILES π
The files used by LPRng are set by values in the printer configuration file. The following are a commonly used set of default values π.
/etc/lprng/lpd.confβ LPRng configuration file${HOME}/.printcapβ user printer description file/etc/printcapβ printer description file/etc/lprng/lpd.permsβ permissions/var/run/lprng/lpdβ lock file for queue control/var/spool/lpdβ spool directories/var/spool/lpd/QUEUE/controlβ queue control/var/spool/lpd/QUEUE/logβ trace or debug log file/var/spool/lpd/QUEUE/acctβ accounting file/var/spool/lpd/QUEUE/statusβ status file
π SEE ALSO π
lpc(8), lpd(8), checkpc(8), lpr(1), lpq(1), lprm(1), printcap(5), lpd.perms(5), pr(1), lprng_certs(1), lprng_index_certs(1).
π©Ί DIAGNOSTICS π©Ί
Most of the diagnostics are self explanatory, bestie. But if you are puzzled over the exact cause of failure, set the debugging level on (-D5) and run again π₯. The debugging information will help you to pinpoint the exact cause of failure. periodt.
π HISTORY π
LPRng is a enhanced printer spooler system with functionality similar to the Berkeley LPR software π. The LPRng mailing list is lprng@lprng.com β subscribe by sending mail to lprng-request@lprng.com with the word subscribe in the body π. The software is available from ftp://ftp.lprng.com/pub/LPRng. go off.
π AUTHOR π
Patrick Powell <papowell@lprng.com>.
and that's the whole page, babe β this manual is LPRng-3.9.0, and it's LPD.CONF(5), so if you see those two lil breadcrumbs at the bottom of the screen, that's just the source and version and date doin their thing π
β¨ π¦
π¦ where this page comes from
- debian bookworm: lprng 3.8.B-6 Β· GPL-2.0-or-later WITH OpenSSL exception OR Artistic-1.0-Perl
- debian trixie: lprng 3.8.B-9 Β· GPL-2.0-or-later WITH OpenSSL exception OR Artistic-1.0-Perl
- ubuntu jammy: lprng 3.8.B-5 Β· GPL-2.0-or-later WITH OpenSSL exception OR Artistic-1.0-Perl
- ubuntu noble: lprng 3.8.B-8build1 Β· GPL-2.0-or-later WITH OpenSSL exception OR Artistic-1.0-Perl
- ubuntu questing: lprng 3.8.B-9
- ubuntu resolute: lprng 3.8.B-10 Β· GPL-2.0-or-later WITH OpenSSL exception OR Artistic-1.0-Perl
- ubuntu stonking: lprng 3.8.B-11 Β· GPL-2.0-or-later WITH OpenSSL exception OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms