]> git.ipfire.org Git - thirdparty/cups.git/blame_incremental - doc/help/man-backend.html
<rdar://problem/16495000> CUPS: Disable gratuitous logging by default
[thirdparty/cups.git] / doc / help / man-backend.html
... / ...
CommitLineData
1<!DOCTYPE HTML>
2<html>
3<!-- SECTION: Man Pages -->
4<head>
5 <link rel="stylesheet" type="text/css" href="../cups-printable.css">
6 <title>backend(7)</title>
7</head>
8<body>
9<h1 class="title">backend(7)</h1>
10
11<h2 class="title"><a name="NAME">Name</a></h2>
12backend - cups backend transmission interfaces
13<h2 class="title"><a name="SYNOPSIS">Synopsis</a></h2>
14<b>backend</b>
15<br>
16<b>backend</b>
17job user title num-copies options [
18<i>filename</i>
19]
20<h2 class="title"><a name="DESCRIPTION">Description</a></h2>
21Backends are a special type of <i>filter(7)</i> which is used to send print data
22to and discover different devices on the system.
23<p>Like filters, backends must be capable of reading from a filename on the
24command-line or from the standard input, copying the standard input to a
25temporary file as required by the physical interface.
26<p>The command name (argv[0]) is set to the device URI of the destination printer.
27Starting with CUPS 1.1.22, any authentication information in argv[0] is removed,
28so backend developers are urged to use the DEVICE_URI environment variable
29whenever authentication information is required. The CUPS API includes a
30<i>cupsBackendDeviceURI</i> function for retrieving the correct device URI.
31<p>Back-channel data from the device should be relayed to the job
32filters by writing to file descriptor 3. The CUPS API includes
33the <i>cupsBackChannelWrite</i> function for this purpose.
34<h2 class="title"><a name="WARNING">Warning</a></h2>
35CUPS backends are not generally design to be run directly by the user. Aside
36from the device URI issue (argv[0] and DEVICE_URI environment variable contain
37the device URI), CUPS backends also expect specific environment variables and
38file descriptors, and typically run in a user session that (on OS X) has
39additional restrictions that affect how it runs. Backends can also be installed
40with restricted permissions (0500 or 0700) that tell the scheduler to run them
41as the "root" user instead of an unprivileged user (typically "lp") on the
42system.
43<p>Unless you are a developer and know what you are doing, please do not run
44backends directly. Instead, use the <i>lp(1)</i> or <i>lpr(1)</i> programs to send
45a print job or <i>lpinfo(8)</i> program to query for available printers using the
46backend. The one exception is the SNMP backend - see <i>snmpbackend(8)</i> for
47more information.
48<h2 class="title"><a name="DEVICE_DISCOVERY">Device Discovery</a></h2>
49When run with no arguments, the backend should list the devices and schemes it
50supports or is advertising to stdout. The output consists of zero or more lines
51consisting of any of the following forms:
52
53<pre>
54 device-class scheme "Unknown" "device-info"
55 device-class device-uri "device-make-and-model" "device-info"
56 device-class device-uri "device-make-and-model" "device-info" "device-id"
57 device-class device-uri "device-make-and-model" "device-info" "device-id" "device-location"
58</pre>
59<p>The <i>device-class</i> field is one of the following values:
60<p style="margin-left: 5.0em; text-indent: -5.0em">direct
61<br>
62<br>
63The device-uri refers to a specific direct-access device with no options, such
64as a parallel, USB, or SCSI device.
65<p style="margin-left: 5.0em; text-indent: -5.0em">file
66<br>
67<br>
68The device-uri refers to a file on disk.
69<p style="margin-left: 5.0em; text-indent: -5.0em">network
70<br>
71<br>
72The device-uri refers to a networked device and conforms to the general form for
73network URIs.
74<p style="margin-left: 5.0em; text-indent: -5.0em">serial
75<br>
76<br>
77The device-uri refers to a serial device with configurable baud rate and other
78options. If the device-uri contains a baud value, it represents the maximum baud
79rate supported by the device.
80<p>The <i>scheme</i> field provides the URI scheme that is supported by the backend.
81Backends should use this form only when the backend supports any URI using that
82scheme. The <i>device-uri</i> field specifies the full URI to use when
83communicating with the device.
84<p>The <i>device-make-and-model</i> field specifies the make and model of the
85device, e.g. "Example Foojet 2000". If the make and model is not known, you must
86report "Unknown".
87<p>The <i>device-info</i> field specifies additional information about the device.
88Typically this includes the make and model along with the port number or network
89address, e.g. "Example Foojet 2000 USB #1".
90<p>The optional <i>device-id</i> field specifies the IEEE-1284 device ID string for
91the device, which is used to select a matching driver.
92<p>The optional <i>device-location</i> field specifies the physical location of
93the device, which is often used to pre-populate the printer-location attribute
94when adding a printer.
95<h2 class="title"><a name="PERMISSIONS">Permissions</a></h2>
96Backends without world execute permissions are run as the root user. Otherwise,
97the backend is run using an unprivileged user account, typically "lp".
98<h2 class="title"><a name="EXIT_CODES">Exit Codes</a></h2>
99The following exit codes are defined for backends; C API constants defined in
100the &lt;cups/backend.h> header file are defined in parenthesis:
101<p style="margin-left: 5.0em; text-indent: -5.0em">0 (CUPS_BACKEND_OK)
102<br>
103<br>
104The print file was successfully transmitted to the device or remote server.
105<p style="margin-left: 5.0em; text-indent: -5.0em">1 (CUPS_BACKEND_FAILED)
106<br>
107<br>
108The print file was not successfully transmitted to the device or remote server.
109The scheduler will respond to this by canceling the job, retrying the job, or
110stopping the queue depending on the state of the error-policy attribute.
111<p style="margin-left: 5.0em; text-indent: -5.0em">2 (CUPS_BACKEND_AUTH_REQUIRED)
112<br>
113<br>
114The print file was not successfully transmitted because valid authentication
115information is required. The scheduler will respond to this by holding the job
116and adding the "cups-held-for-authentication" keyword to the "job-reasons"
117attribute.
118<p style="margin-left: 5.0em; text-indent: -5.0em">3 (CUPS_BACKEND_HOLD)
119<br>
120<br>
121The print file was not successfully transmitted because it cannot be printed at
122this time. The scheduler will respond to this by holding the job.
123<p style="margin-left: 5.0em; text-indent: -5.0em">4 (CUPS_BACKEND_STOP)
124<br>
125<br>
126The print file was not successfully transmitted because it cannot be printed at
127this time. The scheduler will respond to this by stopping the queue.
128<p style="margin-left: 5.0em; text-indent: -5.0em">5 (CUPS_BACKEND_CANCEL)
129<br>
130<br>
131The print file was not successfully transmitted because one or more attributes
132are not supported or the job was canceled at the printer. The scheduler will
133respond to this by canceling the job.
134<p style="margin-left: 5.0em; text-indent: -5.0em">6 (CUPS_BACKEND_RETRY)
135<br>
136<br>
137The print file was not successfully transmitted because of a temporary issue.
138The scheduler will retry the job at a future time - other jobs may print before
139this one.
140<p style="margin-left: 5.0em; text-indent: -5.0em">7 (CUPS_BACKEND_RETRY_CURRENT)
141<br>
142<br>
143The print file was not successfully transmitted because of a temporary issue.
144The scheduler will retry the job immediately without allowing intervening jobs.
145<p>All other exit code values are reserved.
146<h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
147<i>cups-snmp(8)</i>, <i>cupsd(8)</i>, <i>cupsd.conf(5)</i>, <i>filter(7)</i>,
148<i>lpinfo(8)</i>,
149<br>
150<a href="http://localhost:631/help">http://localhost:631/help</a>
151<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
152Copyright 2007-2013 by Apple Inc.
153
154</body>
155</html>