which is used to send print data to and discover different devices on the system.
<p>Like filters, backends must be capable of reading from a filename on the command-line or from the standard input, copying the standard input to a temporary file as required by the physical interface.
<p>The command name (<i>argv[0]</i>) is set to the device URI of the destination printer.
Authentication information in
<i>argv[0]</i>
is removed, so backend developers are urged to use the
<b>DEVICE_URI</b>
environment variable whenever authentication information is required. The
<b>cupsBackendDeviceURI</b>()
function may be used to retrieve the correct device URI.
<p>Back-channel data from the device should be relayed to the job filters using the <i>cupsBackChannelWrite</i> function.
<p>Backends are responsible for reading side-channel requests using the
<b>cupsSideChannelRead</b>()
function and responding with the
<b>cupsSideChannelWrite</b>()
function. The
<b>CUPS_SC_FD</b>
constant defines the file descriptor that should be monitored for incoming requests.
The following exit codes are defined for backends:
<dlclass="man">
<dt><b>CUPS_BACKEND_OK</b>
<ddstyle="margin-left: 5.0em">The print file was successfully transmitted to the device or remote server.
<dt><b>CUPS_BACKEND_FAILED</b>
<ddstyle="margin-left: 5.0em"><br>
The print file was not successfully transmitted to the device or remote server.
The scheduler will respond to this by canceling the job, retrying the job, or stopping the queue depending on the state of the
<i>printer-error-policy</i>
attribute.
<dt><b>CUPS_BACKEND_AUTH_REQUIRED</b>
<ddstyle="margin-left: 5.0em">The print file was not successfully transmitted because valid authentication information is required.
The scheduler will respond to this by holding the job and adding the 'cups-held-for-authentication' keyword to the "job-reasons" Job Description attribute.
<dt><b>CUPS_BACKEND_HOLD</b>
<ddstyle="margin-left: 5.0em">The print file was not successfully transmitted because it cannot be printed at this time.
The scheduler will respond to this by holding the job.
<dt><b>CUPS_BACKEND_STOP</b>
<ddstyle="margin-left: 5.0em">The print file was not successfully transmitted because it cannot be printed at this time.
The scheduler will respond to this by stopping the queue.
<dt><b>CUPS_BACKEND_CANCEL</b>
<ddstyle="margin-left: 5.0em">The print file was not successfully transmitted because one or more attributes are not supported or the job was canceled at the printer.
The scheduler will respond to this by canceling the job.
<dt><b>CUPS_BACKEND_RETRY</b>
<ddstyle="margin-left: 5.0em">The print file was not successfully transmitted because of a temporary issue.
The scheduler will retry the job at a future time - other jobs may print before this one.
<dt><b>CUPS_BACKEND_RETRY_CURRENT</b>
<ddstyle="margin-left: 5.0em">The print file was not successfully transmitted because of a temporary issue.
The scheduler will retry the job immediately without allowing intervening jobs.
CUPS backends can expect the following environment variable:
<dlclass="man">
<dt><b>DEVICE_URI</b>
<ddstyle="margin-left: 5.0em">The device URI associated with the printer.
</dl>
<h2class="title"><aname="FILES">Files</a></h2>
<i>/etc/cups/cups-files.conf</i>
<h2class="title"><aname="NOTES">Notes</a></h2>
CUPS backends are not generally designed to be run directly by the user.
Aside from the device URI issue (
<i>argv[0]</i>
and
<b>DEVICE_URI</b>
environment variable contain the device URI), CUPS backends also expect specific environment variables and file descriptors, and typically run in a user session that (on macOS) has additional restrictions that affect how it runs.
Backends can also be installed with restricted permissions (0500 or 0700) that tell the scheduler to run them as the "root" user instead of an unprivileged user (typically "lp") on the system.
<p>Unless you are a developer and know what you are doing, please do not run backends directly.