LinuxCommandLibrary

cups-deviced

Discover network printers for CUPS

SYNOPSIS

cups-deviced [-d level] [-h]

PARAMETERS

-d level
    Set debug logging level (integer, output to syslog)

-h
    Display command usage and exit

DESCRIPTION

cups-deviced is a lightweight daemon in the CUPS (Common UNIX Printing System) that discovers and enumerates local printing devices, primarily USB printers, parallel ports, and other directly attached hardware. It listens on an abstract Unix domain socket (typically @/run/cups/deviced) for queries from the CUPS scheduler cupsd(8).

Upon receiving a request like GET-DEVICES 1.0 localhost "usb://*", it scans hardware using libusb for USB devices and other system calls for local interfaces. It responds with a list of available devices in CUPS backend format: one line per device, structured as direct <uri> <network> "<info>" "<make>" "<model>".

For example:
direct usb://HP/LaserJet?serial=ABC123 "HP LaserJet" "HP" "HP LaserJet P4014" "MFG:HP;CMD:MLC,PCL,PML;MDL:HP LaserJet P4014;CLS:PRINTER;DES:HP LaserJet P4014;SN:ABC123;"

This enables automatic printer queue creation via lpadmin(8). Started automatically by systemd or init scripts, it enhances CUPS portability by centralizing discovery logic, avoiding distribution-specific udev rules. Requires root for hardware access; debug output logs to syslog.

Manual invocation daemonizes by default; use -d for testing.

CAVEATS

Requires root privileges for USB/hardware access. Daemonizes on start; manual testing needs -d and nohup or similar. Only supports local devices, not network discovery.

SOCKET LOCATION

Listens on abstract Unix socket @/run/cups/deviced (cupsd connects automatically)

QUERY PROTOCOL

cupsd sends lines like GET-DEVICES 1.0 <host> <scheme>; responds with device list or NO-DEVICES

TESTING

Run as root: cups-deviced -d 2 &; then cupsd -t or lpinfo -v -l to query

HISTORY

Introduced in CUPS 2.2.2 (January 2018) to consolidate device discovery, replacing udev rules (/lib/udev/rules.d/60-cups.rules) and hotplug scripts from prior versions. Evolved in CUPS 2.3+ for better systemd integration and libusb backend unification.

SEE ALSO

cupsd(8), lpinfo(1), cups-browsed(8), usb(8)

Copied to clipboard