Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
CUPS
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Overview == [[File:Cups simple.svg|150px|right]] CUPS provides a mechanism that allows print jobs to be sent to printers in a standard fashion. The print data goes to a ''scheduler''<ref name="scheduler">{{cite web|website=CUPS documentation|publisher=[[Apple Inc.]]|url=https://www.cups.org/doc/spec-design.html|title=CUPS Design Description|at=Scheduler|access-date=December 31, 2020}}</ref> which sends jobs to a ''filter system'' that converts the print job into a format the printer will understand.<ref name="Filters">{{cite web|website=CUPS documentation|publisher=[[Apple Inc.]]|url=https://www.cups.org/doc/spec-design.html|title=CUPS Design Description|at=Filters|access-date=December 31, 2020}}</ref> The filter system then passes the data on to a ''backend''βa special filter that sends print data to a device or network connection.<ref name="backend">{{cite web|website=CUPS documentation|publisher=[[Apple Inc.]]|url=https://www.cups.org/doc/spec-design.html|title=CUPS Design Description|at=Backend|access-date=December 31, 2020}}</ref> The system makes extensive use of [[PostScript]] and [[raster graphics|rasterization]] of data to convert the data into a format suitable for the destination printer. CUPS offers a standard and modularised printing system that can process numerous data formats on the print server. Before CUPS, it was difficult to find a standard printer management system that would accommodate the very wide variety of printers on the market using their own printer languages and formats. For instance, the System V and Berkeley printing systems were largely incompatible with each other, and they required complicated scripts and workarounds to convert the program's data format to a printable format. They often could not detect the file format that was being sent to the printer and thus could not automatically and correctly convert the data stream. Additionally, data conversion was performed on individual workstations rather than a central server. CUPS allows printer manufacturers and printer-driver developers to create drivers more easily that work natively on the print server. Processing occurs on the server, allowing for easier network-based printing than with other Unix printing systems. With [[Samba software|Samba]] installed, users can address printers on remote Windows computers, and generic PostScript drivers can be used for printing across the network. === Scheduler === The CUPS scheduler implements [[Internet Printing Protocol]] (IPP) over HTTP/1.1. A helper application (cups-lpd) converts [[Line Printer Daemon protocol]] (LPD) requests to IPP. The scheduler also provides a web-based interface for managing print jobs, the configuration of the server, and for documentation about CUPS itself.<ref name="scheduler" /> An ''authorization'' module controls which IPP and HTTP messages can pass through the system.<ref name="auth">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Design|url=http://www.cups.org/doc-1.1/sdd.html#3_8_1|title=Authorization|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_8_1|archive-date=January 10, 2007}}</ref> Once the IPP/HTTP packets are authorized they are sent to the ''client'' module, which listens for and processes incoming connections. The client module is also responsible for executing external [[Common Gateway Interface|CGI]] programs as needed to support web-based printers, classes, and job status monitoring and administration.<ref name="clientmodule">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Administrators Manual|url=http://www.cups.org/doc-1.1/sdd.html#3_8_3|title=Authorisation|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_8_3|archive-date=January 10, 2007}}</ref> Once this module has processed its requests, it sends them to the ''IPP'' module which performs [[Uniform Resource Identifier]] (URI) validation to prevent a client from sidestepping any [[access control]]s or [[authentication]] on the HTTP server.<ref name="ippmodule">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Design|url=http://www.cups.org/doc-1.1/sdd.html#3_8_7|title=IPP|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_8_7|archive-date=January 10, 2007}}</ref> The URI is a text [[String (computer science)|string]] that indicates a name or address that can be used to refer to an abstract or physical resource on a network. The scheduler allows for classes of printers. Applications can send requests to groups of printers in a class, allowing the scheduler to direct the job to the first available printer in that class.<ref name="classes">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Administrators Manual|url=http://www.cups.org/doc-1.1/sam.html#2_4|title=Classes|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070106145359/http://www.cups.org/doc-1.1/sam.html#2_4|archive-date=January 6, 2007}}</ref> A ''jobs'' module manages print jobs, sending them to the filter and backend processes for final conversion and printing, and monitoring the status messages from those processes.<ref name="jobs">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Administrators Manual|url=http://www.cups.org/doc-1.1/sam.html#2_3|title=Jobs|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070106145359/http://www.cups.org/doc-1.1/sam.html#2_3|archive-date=January 6, 2007}}</ref> The CUPS scheduler utilizes a ''configuration'' module, which parses configuration files, initializes CUPS [[data structure]]s, and starts and stops the CUPS program. The configuration module will stop CUPS services during configuration file processing and then restart the service when processing is complete.<ref name="configurationmodule">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Design|url=http://www.cups.org/doc-1.1/sdd.html#3_8_4|title=Configuration|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_8_4|archive-date=January 10, 2007}}</ref> A ''logging'' module handles the logging of scheduler events for access, error, and page [[Computer data logging|log files]]. The ''main'' module handles timeouts and dispatch of I/O requests for client connections, watching for [[Signal (computing)|signals]], handling child process errors and exits, and reloading the server configuration files as needed.<ref name="loggingmodule">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Design|url=http://www.cups.org/doc-1.1/sdd.html#3_8_9|title=Logging|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_8_9|archive-date=January 10, 2007}}</ref> Other modules used by the scheduler include: * the ''MIME'' module, which handles a [[Multipurpose Internet Mail Extensions]] (MIME) type and conversion database used in the filtering process that converts print data to a format suitable for a print device;<ref name="MIMEmodule">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Design|url=http://www.cups.org/doc-1.1/sdd.html#3_8_11|title=MIME|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_8_11|archive-date=January 10, 2007}}</ref> * a ''PPD'' module that handles a list of [[Postscript Printer Description]] (PPD) files;<ref name="ppdmodule">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Design|url=http://www.cups.org/doc-1.1/sdd.html#3_8_12|title=PPD|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_8_12|archive-date=January 10, 2007}}</ref> * a ''devices'' module that manages a list of devices that are available in the system;<ref name="devicesmodule">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Design|url=http://www.cups.org/doc-1.1/sdd.html#3_8_5|title=Devices|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_8_5|archive-date=January 10, 2007}}</ref> * a ''printers'' module that handles printers and PPDs within CUPS.<ref name="printersmodule">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Design|url=http://www.cups.org/doc-1.1/sdd.html#3_8_13|title=Printers|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_8_13|archive-date=January 10, 2007}}</ref> === Filter system === [[File:CUPS-block-diagram.svg|200px|thumb|CUPS allows users to send different data to the CUPS server and have that data converted into a format the printer will understand and be able to print]] CUPS can process a variety of data formats on the print server. It converts the print-job data into the final language/format of the printer via a series of ''filters''.<ref name="filtersadmin">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Administrators Manual|url=http://www.cups.org/doc-1.1/sam.html#2_5|title=Filters|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070106145359/http://www.cups.org/doc-1.1/sam.html#2_5|archive-date=January 6, 2007}}</ref><ref name="filters_sdd">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Design|url=http://www.cups.org/doc-1.1/sdd.html#3_7|title=Filters|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_7|archive-date=January 10, 2007}}</ref> It uses [[Internet media type|MIME types]] for identifying file formats. ==== MIME databases ==== After the CUPS system has assigned the print job to the scheduler, it is passed to the CUPS filter system. This converts the data to a format suitable for the printer. During start-up, the CUPS daemon loads two MIME databases: <code>mime.types</code> that defines the known file types that CUPS can accept data for, and <code>mime.convs</code> that defines the programs that process each particular MIME type.<ref name="MIMEadmin">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Administrators Manual|url=http://www.cups.org/doc-1.1/sam.html#FILE_TYPING_FILTERING|title=File Typing and Filtering|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070106145359/http://www.cups.org/doc-1.1/sam.html#FILE_TYPING_FILTERING|archive-date=January 6, 2007}}</ref> The <code>mime.types</code> file has the syntax: <code>mimetype { [file-extensions] | [pattern-match] }</code> For example, to detect an [[HTML]] file, the following entry would be applicable: <code>text/html html htm \</code><br/> :<code>printable(0,1024) + (string(0,"<nowiki><HTML></nowiki>") string(0,"<!DOCTYPE"))</code> The second line matches the file contents to the specified MIME type by determining that the first kilobyte of text in the file holds printable characters and that those characters include HTML markup. If the pattern above matches, then the filter system would mark the file as the MIME type text/html.<ref name="mime_types">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Administrators Manual|url=http://www.cups.org/doc-1.1/sam.html#7_13_1|title=mime.types|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070106145359/http://www.cups.org/doc-1.1/sam.html#7_13_1|archive-date=January 6, 2007}}</ref> The <code>mime.convs</code> file has the syntax: <code>source destination cost program</code> The ''source'' field designates the MIME type that is determined by looking up the <code>mime.types</code> file, while the ''destination'' field lists the type of output requested and determines what program should be used. This is also retrieved from <code>mime.types</code>. The ''cost'' field assists in the selection of sets of filters when converting a file. The last field, ''program'', determines which filter program to use to perform the data conversion.<ref name="mime_convs">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Administrators Manual|url=http://www.cups.org/doc-1.1/sam.html#7_13_Γ©|title=mime.convs|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070106145359/http://www.cups.org/doc-1.1/sam.html#7_13_Γ©|archive-date=January 6, 2007}}</ref> Some examples: text/plain application/postscript 50 texttops application/vnd.cups-postscript application/vnd.cups-raster 50 pstoraster image/* application/vnd.cups-postscript 50 imagetops image/* application/vnd.cups-raster 50 imagetoraster ==== Filtering process ==== The filtering process works by taking input data pre-formatted with six arguments: # the job ID of the print job # the user name # the job name # the number of copies to print # any print options # the filename (though this is unnecessary if it has been redirected from [[standard input]]).<ref name="filters_sdd"/> It then determines the type of data that is being input and the filter to be used through the use of the MIME databases; for instance, image data will be detected and processed through a particular filter, and HTML data detected and processed through another filter. CUPS can convert supplied data either into [[PostScript]] data or directly into raster data. If it is converted into PostScript data an additional filter is applied called a ''prefilter'', which runs the PostScript data through another PostScript converter so that it can add printer-specific options like selecting page ranges to print, setting ''n''-up mode and other device-specific things.<ref name="pstops">{{cite web|work=[[Easy Software Products]]|publisher=CUPS Software Administrators Manual|url=http://www.cups.org/doc-1.1/sdd.html#3_7_5|title=pstops|access-date=January 9, 2007|url-status=dead|archive-url=https://web.archive.org/web/20070110180805/http://www.cups.org/doc-1.1/sdd.html#3_7_5|archive-date=January 10, 2007}}</ref> After the pre-filtering is done, the data can either be sent directly to a CUPS [[#Backends|backend]] if using a PostScript printer, or it can be passed to another filter like [[Foomatic]] by [[linuxprinting.org]]. Alternatively, it can be passed to [[Ghostscript]], which converts the PostScript into an intermediary ''CUPS-raster'' format.<ref name="cups-raster MIME type">The MIME type for the CUPS raster format is application/vnd.cups-raster.</ref> The intermediary raster format is then passed onto a final filter which converts the raster data to a printer-specific format. The default filters included with CUPS include: * raster to [[Printer Command Language|PCL]] * raster to [[ESC/P]] or [[ESC/P2]] (an [[Epson]] printer language, now largely superseded by their new ESC/P-Raster format) * raster to [[Dymo]] (another printer company). * raster to Zebra Programming Language or ZPL (a [[Zebra Technologies]] printer language) {{As of | 2009}} other proprietary languages like GDI or SPL (Samsung Printer Language) are supported by Splix, a raster to SPL translator.<ref>{{Cite web|url=http://splix.sourceforge.net/|title=SPL driver for UNIX|website=splix.sourceforge.net}}</ref> However, several other alternatives can integrate with CUPS. [[HPLIP]] (previously known as HP-IJS) provides Linux+CUPS drivers for HP printers, [[Gutenprint]] (previously known as Gimp-Print) is a range of high-quality printer drivers for (mostly) inkjet printers, and [[TurboPrint]] for Linux has another range of quality printer drivers for a wide range of printers. === Backends === The backends are the ways in which CUPS sends data to printers. There are several backends available for CUPS: [[parallel port|parallel]], [[serial port|serial]], and [[USB]] ports, cups-pdf<ref>{{cite web|url=https://packages.debian.org/wheezy/cups-pdf|title=Debian - Details of package cups-pdf in wheezy|url-status=live|archive-url=https://web.archive.org/web/20150501081102/https://packages.debian.org/wheezy/cups-pdf|archive-date=May 1, 2015}}</ref> PDF Virtual Printing, as well as network backends that operate via the [[Internet Printing Protocol|IPP]], [[JetDirect]] (AppSocket), [[Line Printer Daemon]] ("LPD"), and [[Server Message Block|SMB]] [[Protocol (computing)|protocol]]s. A new <code>mdns</code> backend in CUPS 1.4 provides [[Bonjour (software)|Bonjour]] ([[DNS-SD]]) based printer discovery.<ref>{{cite web|url=http://www.cups.org/documentation.php/doc-1.4/whatsnew.html|title=What's New in CUPS 1.4|url-status=dead|archive-url=https://web.archive.org/web/20121102142550/http://cups.org/documentation.php/doc-1.4/whatsnew.html|archive-date=November 2, 2012}}</ref> In CUPS 1.6, Bonjour printer discovery and sharing using [[Avahi (software)|Avahi]] is also supported.<ref>{{cite web|url=http://www.cups.org/documentation.php/doc-1.6/whatsnew.html|title=What's New in CUPS 1.6|url-status=dead|archive-url=https://web.archive.org/web/20121004041235/http://cups.org/documentation.php/doc-1.6/whatsnew.html|archive-date=October 4, 2012}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)