Package: cups-server-common Version: 1.6.3-1 Severity: normal Dear Maintainer!
I have the HP Laserjet P2055 connected via USB. If I submit a job and the printer is not connected, the printer status goes to pause. If I connect the printer to the usb ports, the status does not change. I have to enable the printer manually. This is not what I expect of the system. If I plug a printer and the printer is enabled, I always intend to enable and use this printer. It would be great if a printer that is already installed in cups goes to status idle automatically after connecting it. I think Debian should provide a solution for this. May be Debian does but it does not work with my special printer. The package system-config-printer-udev does not help. I attach some udevadm outputs that may help. Partial solution: -------------- I tried to solve this problem with an udev rule. The rule ACTION=="add" SUBSYSTEM=="usbmisc", KERNEL=="lp*", RUN=="/usr/local/bin/cupsenablebyserial.sh %s{serial}" calls a script cupsenablebyserial.sh. It works almost fine. But I need the serial as a parameter to be able to enable the correct printer. For some reasons the %s{serial} is empty. The helper script should be something like this: #!/bin/sh if [ -z "$1" ] then echo Failed to enable usb printer. /usr/local/bin/cupsenablebyserial called withoud a valid serial. Please report this bug to debian team and help them to fix this. >> /var/log/cups/error_log exit fi printer_name=$(lpstat -v | grep $1 | awk '{print $3}' | sed s/://g) if [ -z "$printer_name" ] then echo Failed to enable usb printer with serial $1. Did you install the printer with this serial? >> /var/log/cups/error_log exit fi cupsenable $printer_name -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (500, 'testing'), (500, 'stable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.12-rc7-amd64 (SMP w/4 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash
#udevadm info --query=all --attribute-walk --name=/dev/usb/lp0 Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device. looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/usbmisc/lp0': KERNEL=="lp0" SUBSYSTEM=="usbmisc" DRIVER=="" looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0': KERNELS=="1-2:1.0" SUBSYSTEMS=="usb" DRIVERS=="usblp" ATTRS{bInterfaceClass}=="07" ATTRS{bInterfaceSubClass}=="01" ATTRS{bInterfaceProtocol}=="02" ATTRS{bNumEndpoints}=="02" ATTRS{supports_autosuspend}=="1" ATTRS{bAlternateSetting}==" 0" ATTRS{bInterfaceNumber}=="00" ATTRS{interface}=="Printer" ATTRS{ieee1284_id}=="MFG:Hewlett-Packard;MDL:HP LaserJet P2055dn;CMD:PJL,POSTSCRIPT,PCL,PCLXL;CLS:PRINTER;DES:HP LaserJet P2055dn;FWVER:20101025;" looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-2': KERNELS=="1-2" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{bDeviceSubClass}=="00" ATTRS{bDeviceProtocol}=="00" ATTRS{devpath}=="2" ATTRS{idVendor}=="03f0" ATTRS{speed}=="480" ATTRS{bNumInterfaces}==" 2" ATTRS{bConfigurationValue}=="1" ATTRS{bMaxPacketSize0}=="64" ATTRS{busnum}=="1" ATTRS{devnum}=="49" ATTRS{configuration}=="" ATTRS{bMaxPower}=="2mA" ATTRS{authorized}=="1" ATTRS{bmAttributes}=="c0" ATTRS{bNumConfigurations}=="1" ATTRS{maxchild}=="0" ATTRS{bcdDevice}=="0001" ATTRS{avoid_reset_quirk}=="0" ATTRS{quirks}=="0x0" ATTRS{serial}=="S2AHXCB" ATTRS{version}==" 2.00" ATTRS{urbnum}=="15" ATTRS{ltm_capable}=="no" ATTRS{manufacturer}=="Hewlett-Packard" ATTRS{removable}=="removable" ATTRS{idProduct}=="5c17" ATTRS{bDeviceClass}=="00" ATTRS{product}=="HP LaserJet P2055dn" looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1': KERNELS=="usb1" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{bDeviceSubClass}=="00" ATTRS{bDeviceProtocol}=="01" ATTRS{devpath}=="0" ATTRS{idVendor}=="1d6b" ATTRS{speed}=="480" ATTRS{bNumInterfaces}==" 1" ATTRS{bConfigurationValue}=="1" ATTRS{bMaxPacketSize0}=="64" ATTRS{authorized_default}=="1" ATTRS{busnum}=="1" ATTRS{devnum}=="1" ATTRS{configuration}=="" ATTRS{bMaxPower}=="0mA" ATTRS{authorized}=="1" ATTRS{bmAttributes}=="e0" ATTRS{bNumConfigurations}=="1" ATTRS{maxchild}=="9" ATTRS{bcdDevice}=="0312" ATTRS{avoid_reset_quirk}=="0" ATTRS{quirks}=="0x0" ATTRS{serial}=="0000:00:14.0" ATTRS{version}==" 2.00" ATTRS{urbnum}=="1233" ATTRS{ltm_capable}=="no" ATTRS{manufacturer}=="Linux 3.12-rc7-amd64 xhci_hcd" ATTRS{removable}=="unknown" ATTRS{idProduct}=="0002" ATTRS{bDeviceClass}=="09" ATTRS{product}=="xHCI Host Controller" looking at parent device '/devices/pci0000:00/0000:00:14.0': KERNELS=="0000:00:14.0" SUBSYSTEMS=="pci" DRIVERS=="xhci_hcd" ATTRS{irq}=="60" ATTRS{subsystem_vendor}=="0x1028" ATTRS{broken_parity_status}=="0" ATTRS{class}=="0x0c0330" ATTRS{consistent_dma_mask_bits}=="64" ATTRS{dma_mask_bits}=="64" ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f" ATTRS{device}=="0x9c31" ATTRS{enable}=="1" ATTRS{msi_bus}=="" ATTRS{local_cpulist}=="0-3" ATTRS{vendor}=="0x8086" ATTRS{subsystem_device}=="0x05e3" ATTRS{numa_node}=="-1" ATTRS{d3cold_allowed}=="1" looking at parent device '/devices/pci0000:00': KERNELS=="pci0000:00" SUBSYSTEMS=="" DRIVERS==""
#udevadm monitor --env monitor will print the received events for: UDEV - the event which udev sends out after rule processing KERNEL - the kernel uevent KERNEL[15174.504849] add /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb) ACTION=add BUSNUM=001 DEVNAME=/dev/bus/usb/001/049 DEVNUM=049 DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2 DEVTYPE=usb_device MAJOR=189 MINOR=48 PRODUCT=3f0/5c17/1 SEQNUM=2738 SUBSYSTEM=usb TYPE=0/0/0 KERNEL[15174.505129] add /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 DEVTYPE=usb_interface INTERFACE=7/1/2 MODALIAS=usb:v03F0p5C17d0001dc00dsc00dp00ic07isc01ip02in00 PRODUCT=3f0/5c17/1 SEQNUM=2739 SUBSYSTEM=usb TYPE=0/0/0 KERNEL[15174.505448] add /class/usbmisc (class) ACTION=add DEVPATH=/class/usbmisc SEQNUM=2740 SUBSYSTEM=class KERNEL[15174.505470] add /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/usbmisc/lp0 (usbmisc) ACTION=add DEVNAME=/dev/usb/lp0 DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/usbmisc/lp0 MAJOR=180 MINOR=0 SEQNUM=2741 SUBSYSTEM=usbmisc KERNEL[15174.505564] add /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 DEVTYPE=usb_interface INTERFACE=255/1/1 MODALIAS=usb:v03F0p5C17d0001dc00dsc00dp00icFFisc01ip01in01 PRODUCT=3f0/5c17/1 SEQNUM=2742 SUBSYSTEM=usb TYPE=0/0/0 UDEV [15174.505827] add /class/usbmisc (class) ACTION=add DEVPATH=/class/usbmisc SEQNUM=2740 SUBSYSTEM=class USEC_INITIALIZED=174505459 UDEV [15202.558174] add /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb) ACTION=add BUSNUM=001 DEVNAME=/dev/bus/usb/001/049 DEVNUM=049 DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2 DEVTYPE=usb_device ID_BUS=usb ID_HPLIP=1 ID_MODEL=HP_LaserJet_P2055dn ID_MODEL_ENC=HP\x20LaserJet\x20P2055dn ID_MODEL_ID=5c17 ID_REVISION=0001 ID_SERIAL=Hewlett-Packard_HP_LaserJet_P2055dn_S2AHXCB ID_SERIAL_SHORT=S2AHXCB ID_USB_INTERFACES=:070102:ff0101: ID_VENDOR=Hewlett-Packard ID_VENDOR_ENC=Hewlett-Packard ID_VENDOR_ID=03f0 MAJOR=189 MINOR=48 PRODUCT=3f0/5c17/1 SEQNUM=2738 SUBSYSTEM=usb TAGS=:udev-acl: TYPE=0/0/0 USEC_INITIALIZED=174504840 hp_test=yes libsane_matched=yes sane_hpaio=yes UDEV [15202.560055] add /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 DEVTYPE=usb_interface INTERFACE=255/1/1 MODALIAS=usb:v03F0p5C17d0001dc00dsc00dp00icFFisc01ip01in01 PRODUCT=3f0/5c17/1 SEQNUM=2742 SUBSYSTEM=usb TYPE=0/0/0 USEC_INITIALIZED=174505609 UDEV [15202.560773] add /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 DEVTYPE=usb_interface INTERFACE=7/1/2 MODALIAS=usb:v03F0p5C17d0001dc00dsc00dp00ic07isc01ip02in00 PRODUCT=3f0/5c17/1 SEQNUM=2739 SUBSYSTEM=usb TYPE=0/0/0 USEC_INITIALIZED=174505152 UDEV [15202.561987] add /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/usbmisc/lp0 (usbmisc) ACTION=add DEVNAME=/dev/usb/lp0 DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/usbmisc/lp0 MAJOR=180 MINOR=0 SEQNUM=2741 SUBSYSTEM=usbmisc USEC_INITIALIZED=4505587