Ubuntu 14.04 64 位(从 12.04 升级),三星 ML-2015(ML-2010)。当我第一次将打印作业发送到打印机时,它打印正常,但打印机状态仍然显示“正在将数据发送到打印机”,而打印机已经打印了页面并可以执行新作业。或者状态可能显示“正在等待打印机可用”,而打印机可用。
它使用 CUPS 库存 PPD 驱动程序。有两个,我都试过了,但都没成功。唯一能让打印机状态更新的方法是等待大约十分钟,或者更改连接的 USB 端口打印机。
它似乎与 apparomor 有某种关联,因为在使用打印机时,我会在 /var/log/syslog 中收到以下行:
Jun 15 13:24:55 ... kernel: [ 827.574712] type=1400 audit(1402824295.658:36): apparmor="DENIED" operation="signal" profile="/usr/sbin/cupsd" pid=1055 comm="cupsd" requested_mask="send" denied_mask="send" signal=term peer="unconfined"
Jun 15 13:24:55 ... kernel: [ 827.574740] type=1400 audit(1402824295.658:37): apparmor="DENIED" operation="signal" profile="/usr/sbin/cupsd" pid=1055 comm="cupsd" requested_mask="send" denied_mask="send" signal=term peer="unconfined"
Jun 15 13:24:55 ... kernel: [ 827.574758] type=1400 audit(1402824295.658:38): apparmor="DENIED" operation="signal" profile="/usr/sbin/cupsd" pid=1055 comm="cupsd" requested_mask="send" denied_mask="send" signal=term peer="unconfined"
另外,我尝试监控日志,当您向打印机发送新作业时,会发现一些有趣的活动:
Jun 15 14:34:37 ... kernel: [ 5014.349170] usb 2-1.2.3: reset full-speed USB device number 31 using ehci-pci
Jun 15 14:34:37 ... kernel: [ 5014.443009] usb 2-1.2.3: USB disconnect, device number 31
Jun 15 14:34:37 ... kernel: [ 5014.443353] usblp0: removed
Jun 15 14:34:37 ... udev-configure-printer: remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.3
Jun 15 14:34:37 ... kernel: [ 5014.517355] usb 2-1.2.3: new full-speed USB device number 32 using ehci-pci
Jun 15 14:34:37 ... kernel: [ 5014.611263] usb 2-1.2.3: New USB device found, idVendor=04e8, idProduct=326c
Jun 15 14:34:37 ... kernel: [ 5014.611274] usb 2-1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jun 15 14:34:37 ... kernel: [ 5014.611281] usb 2-1.2.3: Product: Samsung ML-2010
Jun 15 14:34:37 ... kernel: [ 5014.611286] usb 2-1.2.3: Manufacturer: Samsung
Jun 15 14:34:37 ... kernel: [ 5014.611291] usb 2-1.2.3: SerialNumber: 3D66BKCP824986L.
Jun 15 14:34:37 ... kernel: [ 5014.612787] usblp 2-1.2.3:1.0: usblp0: USB Bidirectional printer dev 32 if 0 alt 0 proto 2 vid 0x04E8 pid 0x326C
Jun 15 14:34:38 ... udev-configure-printer: add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.3/2-1.2.3:1.0
Jun 15 14:34:38 ... udev-configure-printer: device devpath is /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.3/2-1.2.3:1.0
Jun 15 14:34:38 ... udev-configure-printer: Device already handled
每 5 秒重复一次。也就是说,每隔五秒钟,某个进程就会通过 ehci-pci 重置打印机 USB 设备,然后该设备消失并再次出现。
答案1
首先运行此命令:
lspci | grep USB
您将获得类似以下 ID:000:00:1a.0、0000:00:1d.0
然后输入以下命令:
echo -n "0000:00:1a.0" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
echo -n "0000:00:1a.0" | tee /sys/bus/pci/drivers/ehci_hcd/bind
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci_hcd/bind
这将重新启动或重置 Ubuntu 中的 USB。现在,尝试再次插入打印机。