D-Bus system services for print queues

Sunday, July 26th, 2009

Further to the recent work on replacing hal-cups-utils, I’ve now split out the parts that use CUPS into a D-Bus system service. This allows udev to simply call the D-Bus methods and let the activated service deal with the potentially time-consuming bits. It also makes it a bit easier to get the SELinux security labelling right.

The interface is simple:

bus com.redhat.PrinterConfig
object /com/redhat/PrinterConfig
interface com.redhat.PrinterConfig

UsbPrinterAdd (STRING devpath, STRING deviceid)
UsbPrinterRemove (STRING devpath)

Next step: a D-Bus service for finding an appropriate PPD file for a given IEEE 1284 Device ID. This would allow the PrinterConfig implementation to avoid running a Python helper script to actually add the queue. The same goes for bluetooth devices.