summaryrefslogtreecommitdiff
path: root/cups.service
diff options
context:
space:
mode:
Diffstat (limited to 'cups.service')
-rw-r--r--cups.service23
1 files changed, 23 insertions, 0 deletions
diff --git a/cups.service b/cups.service
new file mode 100644
index 0000000..a3ca787
--- /dev/null
+++ b/cups.service
@@ -0,0 +1,23 @@
+[Unit]
+Description=CUPS Printing Service
+Wants=portreserve.service
+After=portreserve.service
+
+[Service]
+ExecStartPre=/sbin/portrelease cups
+ExecStart=/usr/sbin/cupsd -f
+
+# This is evil stuff. CUPS should use proper enumeration instead of
+# retriggering these devices. CUPS folks, please fix this, otherwise Kay will
+# come after you!
+ExecStartPost=/sbin/udevadm trigger --subsystem-match=usb --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01
+ExecStartPost=/sbin/udevadm trigger --subsystem-match=usb --property-match=DEVNAME=/dev/usb/lp*
+
+[Install]
+# This is activated via any of these three triggers:
+# 1. Somebody connects to its sockets
+# 2. A file is in the spool directory
+# 3. A printer is plugged in
+# This follows the same scheme MacOS uses to spawn CUPS only when necessary
+Also=cups.socket cups.path
+WantedBy=printer.target