HOME

TheInfoList



OR:

CUPS (formerly an
acronym An acronym is a type of abbreviation consisting of a phrase whose only pronounced elements are the initial letters or initial sounds of words inside that phrase. Acronyms are often spelled with the initial Letter (alphabet), letter of each wor ...
for Common UNIX Printing System) is a modular
printing Printing is a process for mass reproducing text and images using a master form or template. The earliest non-paper products involving printing include cylinder seals and objects such as the Cyrus Cylinder and the Cylinders of Nabonidus. The ...
system for
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
computer
operating systems An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
which allows a computer to act as a print server. A computer running CUPS is a host that can accept print jobs from client computers, process them, and send them to the appropriate printer. CUPS consists of a print spooler and scheduler, a filter system that converts the print data to a format that the printer will understand, and a backend system that sends this data to the print device. CUPS uses the Internet Printing Protocol (IPP) as the basis for managing print jobs and queues. It also provides the traditional
command line interface A command-line interface (CLI) is a means of interacting with software via commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternati ...
s for the
System V Unix System V (pronounced: "System Five") is one of the first commercial versions of the Unix operating system. It was originally developed by AT&T and first released in 1983. Four major versions of System V were released, numbered 1, 2, 3, an ...
and Berkeley print systems, and provides support for the Berkeley print system's Line Printer Daemon protocol and limited support for the
Server Message Block Server Message Block (SMB) is a communication protocol used to share files, printers, serial ports, and miscellaneous communications between nodes on a network. On Microsoft Windows, the SMB implementation consists of two vaguely named Windows ...
(SMB) protocol. System administrators can configure the
device driver In the context of an operating system, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabli ...
s which CUPS supplies by editing text files in Adobe's PostScript Printer Description (PPD) format. There are a number of user interfaces for different platforms that can configure CUPS, and it has a built-in web-based interface. CUPS is
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
, provided under the
Apache License The Apache License is a permissive free software license written by the Apache Software Foundation (ASF). It allows users to use the software for any purpose, to distribute it, to modify it, and to distribute modified versions of the software ...
.


History

Michael Sweet, who owned Easy Software Products, started developing CUPS in 1997 and the first public betas appeared in 1999. The original design of CUPS used the Line Printer Daemon protocol (LPD), but due to limitations in LPD and vendor incompatibilities, the Internet Printing Protocol (IPP) was chosen instead. CUPS was initially called "The Common UNIX Printing System". This name was shortened to just "CUPS" beginning with CUPS 1.4 due to legal concerns with the UNIX trademark. CUPS was quickly adopted as the default printing system for most
Linux distribution A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s. In March 2002,
Apple Inc. Apple Inc. is an American multinational corporation and technology company headquartered in Cupertino, California, in Silicon Valley. It is best known for its consumer electronics, software, and services. Founded in 1976 as Apple Comput ...
adopted CUPS as the printing system for
Mac OS X macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
10.2. In February 2007,
Apple Inc. Apple Inc. is an American multinational corporation and technology company headquartered in Cupertino, California, in Silicon Valley. It is best known for its consumer electronics, software, and services. Founded in 1976 as Apple Comput ...
hired chief developer Michael Sweet and purchased the CUPS source code. On December 20, 2019, Michael Sweet announced on his blog that he had left Apple. In 2020, the OpenPrinting organization forked the project, with Michael Sweet continuing work on it. Apple retained the builds for macOS,
iOS Ios, Io or Nio (, ; ; locally Nios, Νιός) is a Greek island in the Cyclades group in the Aegean Sea. Ios is a hilly island with cliffs down to the sea on most sides. It is situated halfway between Naxos and Santorini. It is about long an ...
, and
iPadOS iPadOS is a mobile operating system developed by Apple for its iPad line of tablet computers. It was given a name distinct from iOS, the operating system used by Apple's iPhones to reflect the diverging features of the two product lines, suc ...
with latest release of Apple CUPS being version 2.3.6 on May 25, 2022. In 2024, a critical vulnerability involving remote code execution in CUPS was found impacting all GNU/Linux systems.


Overview

CUPS provides a mechanism that allows print jobs to be sent to printers in a standard fashion. The print data goes to a ''scheduler'' which sends jobs to a ''filter system'' that converts the print job into a format the printer will understand. The filter system then passes the data on to a ''backend''—a special filter that sends print data to a device or network connection. The system makes extensive use of
PostScript PostScript (PS) is a page description language and dynamically typed, stack-based programming language. It is most commonly used in the electronic publishing and desktop publishing realm, but as a Turing complete programming language, it c ...
and 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 Samba () is a broad term for many of the rhythms that compose the better known Brazilian music genres that originated in the Afro-Brazilians, Afro Brazilian communities of Bahia in the late 19th century and early 20th century, It is a name or ...
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. An ''authorization'' module controls which IPP and HTTP messages can pass through the system. 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 CGI programs as needed to support web-based printers, classes, and job status monitoring and administration. Once this module has processed its requests, it sends them to the ''IPP'' module which performs
Uniform Resource Identifier A Uniform Resource Identifier (URI), formerly Universal Resource Identifier, is a unique sequence of characters that identifies an abstract or physical resource, such as resources on a webpage, mail address, phone number, books, real-world obje ...
(URI) validation to prevent a client from sidestepping any
access control In physical security and information security, access control (AC) is the action of deciding whether a subject should be granted or denied access to an object (for example, a place or a resource). The act of ''accessing'' may mean consuming ...
s or
authentication Authentication (from ''authentikos'', "real, genuine", from αὐθέντης ''authentes'', "author") is the act of proving an Logical assertion, assertion, such as the Digital identity, identity of a computer system user. In contrast with iden ...
on the HTTP server. The URI is a text
string String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * ''Strings'' (1991 film), a Canadian anim ...
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. 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. The CUPS scheduler utilizes a ''configuration'' module, which parses configuration files, initializes CUPS
data structure In computer science, a data structure is a data organization and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the relationships amo ...
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. A ''logging'' module handles the logging of scheduler events for access, error, and page log files. The ''main'' module handles timeouts and dispatch of I/O requests for client connections, watching for
signals A signal is both the process and the result of Signal transmission, transmission of data over some transmission media, media accomplished by embedding some variation. Signals are important in multiple subject fields including signal processin ...
, handling child process errors and exits, and reloading the server configuration files as needed. 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; * a ''PPD'' module that handles a list of Postscript Printer Description (PPD) files; * a ''devices'' module that manages a list of devices that are available in the system; * a ''printers'' module that handles printers and PPDs within CUPS.


Filter system

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''. It uses 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: mime.types that defines the known file types that CUPS can accept data for, and mime.convs that defines the programs that process each particular MIME type. The mime.types file has the syntax: mimetype For example, to detect an
HTML Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets ( ...
file, the following entry would be applicable: text/html html htm \
:printable(0,1024) + (string(0,"") string(0," 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. The mime.convs file has the syntax: source destination cost program The ''source'' field designates the MIME type that is determined by looking up the mime.types file, while the ''destination'' field lists the type of output requested and determines what program should be used. This is also retrieved from mime.types. 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. 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). 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 PostScript (PS) is a page description language and dynamically typed, stack-based programming language. It is most commonly used in the electronic publishing and desktop publishing realm, but as a Turing complete programming language, it c ...
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. After the pre-filtering is done, the data can either be sent directly to a CUPS 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.The MIME type for the CUPS raster format is application/vnd.cups-raster. 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 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) other proprietary languages like GDI or SPL (Samsung Printer Language) are supported by Splix, a raster to SPL translator. 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, serial, and
USB Universal Serial Bus (USB) is an industry standard, developed by USB Implementers Forum (USB-IF), for digital data transmission and power delivery between many types of electronics. It specifies the architecture, in particular the physical ...
ports, cups-pdf PDF Virtual Printing, as well as network backends that operate via the IPP, JetDirect (AppSocket), Line Printer Daemon ("LPD"), and SMB protocols. A new mdns backend in CUPS 1.4 provides Bonjour ( DNS-SD) based printer discovery. In CUPS 1.6, Bonjour printer discovery and sharing using Avahi is also supported.


Compatibility

CUPS provides both the System V and Berkeley printing commands, so users can continue with traditional commands for printing via CUPS. CUPS uses port 631 (TCP and UDP), which is the standard IPP port, and optionally on port 515 by
inetd inetd (internet service daemon) is a super-server Daemon (computer software), daemon on many Unix systems that provides Internet services. For each configured service, it listens for requests from connecting clients. Requests are served by spawn ...
, launchd, the Solaris Service Management Facility, or
xinetd In computer networking, xinetd (''Extended Internet Service Daemon'') is an open-source software, open-source super-server Daemon (computer software), daemon which runs on many Unix-like operating system, systems, and manages Internet-based conne ...
which use the cups-lpd helper program to support LPD printing. When CUPS is installed the lp System V printing system command and the lpr Berkeley printing system commands are installed as compatible programs. This allows a standard interface to CUPS and allows maximum compatibility with existing applications that rely on these printing systems.


User interface tools

Several tools exist to help set up CUPS.


CUPS web-based administration interface

On all platforms, CUPS has a web-based administration interface that runs on
port A port is a maritime facility comprising one or more wharves or loading areas, where ships load and discharge cargo and passengers. Although usually situated on a sea coast or estuary, ports can also be found far inland, such as Hamburg, Manch ...
631. It particularly helps organisations that need to monitor print jobs and add print queues and printers remotely. CUPS 1.0 provided a simple class, job, and printer-monitoring interface for web browsers. CUPS 1.1 replaced this interface with an enhanced administration interface that allows users to add, modify, delete, configure, and control classes, jobs, and printers. CUPS 1.2 and later provide a revamped web interface which features improved readability and design, support for automatically discovered printers, and better access to system logs and advanced settings.


GNOME

In
GNOME A gnome () is a mythological creature and diminutive spirit in Renaissance magic and alchemy, introduced by Paracelsus in the 16th century and widely adopted by authors, including those of modern fantasy literature. They are typically depict ...
starting from GNOME 3, CUPS printing has been handled in the Settings application, which is part of the
GNOME Core Applications The GNOME Core Applications (also known as Apps for GNOME) are a software suite of software applications that are packaged as part of the standard free and open-source GNOME desktop environment. GNOME Core Applications have a consistent look and ...
. The GUI can add CUPS printers and manage CUPS printers and queues. Before GNOME 3, the
GNOME A gnome () is a mythological creature and diminutive spirit in Renaissance magic and alchemy, introduced by Paracelsus in the 16th century and widely adopted by authors, including those of modern fantasy literature. They are typically depict ...
Print Settings (formerly called CUPS Manager) were used to perform these tasks. GNOME's
widget toolkit A widget toolkit, widget library, GUI toolkit, or UX library is a library (computing), library or a collection of libraries containing a set of graphical control elements (called ''widgets'') used to construct the graphical user interface (GUI) of ...
GTK+ GTK (formerly GIMP ToolKit and GTK+) is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary s ...
included integrated printing support based on CUPS in its version 2.10, released in 2006.


KDE

The KDEPrint framework for
KDE KDE is an international free software community that develops free and open-source software. As a central development hub, it provides tools and resources that enable collaborative work on its projects. Its products include the KDE Plasma gra ...
contains various GUI tools that act as CUPS front ends and allows the administration of classes, print queues and print jobs; it includes a printer wizard to assist with adding new printers amongst other features. KDEPrint first appeared in KDE 2.2. KDEPrint supports several different printing platforms, with CUPS one of the best supported. It replaced a previous version of printing support in KDE, ''qtcups'' and is backwards compatible with this module of KDE. ''kprinter'', a dialogue-box program, serves as the main tool for sending jobs to the print device; it can also be started from the
command line A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
. KDEPrint includes a system to pre-filter any jobs before they are handed over to CUPS, or to handle jobs all on its own, such as converting files to
PDF Portable document format (PDF), standardized as ISO 32000, is a file format developed by Adobe Inc., Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, computer hardware, ...
. These filters are described by a pair of Desktop/
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
files. KDEPrint's main components include: * a Print Dialog box, which allows printer properties to be modified * a Print Manager, which allows management of printers, such as adding and removing printers, through an Add Printer Wizard * a Job Viewer/Manager, which manages printer jobs, such as hold/release, cancel and move to another printer * a CUPS configuration module (integrated into KDE)


Mac OS X

In Mac OS X 10.5, printers are configured in the Print & Fax panel in System Preferences, and in printer proxy applications which display the print queues and allow additional configuration after printers are set up. Earlier versions of Mac OS X also included a Printer Setup Utility, which supplied configuration options missing from earlier versions of the Print & Fax preference pane.


PrinterSetup

The PrinterSetup system can manage CUPS queues. It takes the approach of assigning a text file to describe each print queue. These 'PrinterSetupFiles' may then be added to other text files called 'PrinterSetupLists'. This allows logical grouping of printers. the PrinterSetup project remains in its infancy.


Red Hat Linux/Fedora

Starting with Red Hat Linux 9, Red Hat provided an integrated print manager based on CUPS and integrated into
GNOME A gnome () is a mythological creature and diminutive spirit in Renaissance magic and alchemy, introduced by Paracelsus in the 16th century and widely adopted by authors, including those of modern fantasy literature. They are typically depict ...
. This allowed adding printers via a user interface similar to the one
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
uses, where a new printer could be added using an ''add new printer wizard'', along with changing default printer properties in a window containing a list of installed printers. Jobs could also be started and stopped using a print manager, and the printer could be paused using a
context menu A context menu (also called contextual, shortcut, and pop up or pop-up menu) is a menu in a graphical user interface (GUI) that appears upon user interaction, such as a right-click mouse operation. A context menu offers a limited set of choic ...
that pops up when the printer icon is right-clicked. Eric Raymond criticised this system in his piece ''The Luxury of Ignorance''. Raymond had attempted to install CUPS using the Fedora Core 1 print manager but found it non-intuitive; he criticised the interface designers for not designing with the user's point of view in mind. He found the idea of printer queues not obvious because users create queues on their local computer but these queues are actually created on the CUPS server. He also found the plethora of queue-type options confusing as he could choose from between networked CUPS (IPP), networked Unix ( LPD), networked Windows ( SMB), networked Novell ( NCP) or networked JetDirect. He found the help file singularly unhelpful and largely irrelevant to a user's needs. Raymond used CUPS as a general topic to show that user-interface design on Linux desktops needs rethinking and more careful design. He stated:
The meta-problem here is that the configuration wizard does all the approved rituals (GUI with standardized clicky buttons, help popping up in a browser, etc. etc.) but doesn't have the central attribute these are supposed to achieve: discoverability. That is, the quality that every point in the interface has prompts and actions attached to it from which you can learn what to do next. Does your project have this quality?


ESP Print Pro

Easy Software Products, the original creators of CUPS, created a GUI, provided support for many printers and implemented a PostScript RIP. ESP Print Pro ran on Windows, UNIX and Linux, but is no longer available and support for this product ended on December 31, 2007.


See also

* Foomatic * Gutenprint * HP Linux Imaging and Printing * Lp (Unix) * LPRng * Scanner Access Now Easy * Spooling * Xprint


References


Further reading


Design of CUPS Filtering System — including the context for Mac OS X ("Jaguar")
''LinuxPrinting.org''. Retrieved January 5, 2005. *
KDE KDE is an international free software community that develops free and open-source software. As a central development hub, it provides tools and resources that enable collaborative work on its projects. Its products include the KDE Plasma gra ...
.
KDEPrint information
'. KDE-printing website. Retrieved January 14, 2005.
How to Manage Printers in Linux
Linux.com, 2015-04-27.


External links

*
OpenPrinting

Universal Plug and Play – Printer Device V 1.0 and Printer Basic Service V 1.0
{{DEFAULTSORT:Cups 1999 software Apple Inc. acquisitions Apple Inc. software Computer printing Device drivers Free PDF software Free software programmed in C Unix network-related software Software using the Apache license