USB attached serial ports have permissions problems

Bug #587409 reported by James Klaas
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: cups

Description: Ubuntu 10.04 LTS
Release: 10.04

cups:
  Installed: 1.4.3-1
  Candidate: 1.4.3-1
  Version table:
 *** 1.4.3-1 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status

I was attempting to set up my SiPix A6 serial printer on my new upgrade of Lucid. Going through the system-config-printer application, the USB serial port doesn't show up as an option. So, I picked other and used "serial:/dev/ttyUSB0?baud=115200+bits=8+parity=none+flow=hard" as my URI. The jobs normally hang out in the queue for a while then fail. Looking at the CUPS logs, it's clear that the server can't even talk to the printer.

Here are my error lines in the CUPS log for one attempt to print to the printer.

E [29/May/2010:23:53:13 -0400] [Job 10] Unable to open device file "/dev/ttyUSB0": Permission denied
E [29/May/2010:23:58:24 -0400] [Job 10] Unable to open device file "/dev/ttyUSB0": Permission denied
E [30/May/2010:00:03:34 -0400] [Job 10] Unable to open device file "/dev/ttyUSB0": Permission denied
E [30/May/2010:00:08:44 -0400] [Job 10] Unable to open device file "/dev/ttyUSB0": Permission denied
E [30/May/2010:00:13:54 -0400] [Job 10] Unable to open device file "/dev/ttyUSB0": Permission denied
E [30/May/2010:00:14:03 -0400] [Job 10] Job aborted after 5 unsuccessful attempts.

I've tested this with setting the permissions on /dev/ttyUSB0 to full open, 666, with the same results.

To do some further testing, I created a file the printer could read following the instructions here: http://www.linuxforums.org/forum/slackware-linux-help/126064-installation-sipix-pocket-printer-slax.html I then ran the serial backend as root by hand and it works fine.

root@myhost:/usr/lib/cups/backend# export DEVICE_URI=serial:/dev/ttyUSB0?baud=115200+bits=8+parity=3Dnone+flow=hard
root@myhost:/usr/lib/cups/backend# ./serial "5" "anonymous" "Test Page" "1" "job-originating-host-name=localhost" "/tmp/test.bin"
STATE: +connecting-to-device
STATE: -connecting-to-device
PAGE: 1 1
DEBUG: Wrote 1152 bytes...
DEBUG: Wrote 1152 bytes...
DEBUG: Wrote 1152 bytes...
...
DEBUG: Wrote 1152 bytes...
DEBUG: Wrote 1152 bytes...
DEBUG: Wrote 764 bytes...

Please let me know if you need any further information from me.

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

This looks like a problem with the apparmour config for cups, I suggest if you add /dev/ttyUSB* to /etc/apparmor.d/usr.sbin.cupsd
in the same way as the /dev/ttyS* rw, line it should fix it.

Dave

Changed in cups (Ubuntu):
status: New → Confirmed
Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Confirmed since I can see the entry missing in the apparmor conf and what he's trying to do seems sane.

Revision history for this message
James Klaas (jklaas) wrote : Re: [Bug 587409] Re: USB attached serial ports have permissions problems

Works for me now. Thank you very much!!.

James

On Sun, May 30, 2010 at 12:16 PM, Dave Gilbert <email address hidden> wrote:
> Confirmed since I can see the entry missing in the apparmor conf and
> what he's trying to do seems sane.
>
> --
> USB attached serial ports have permissions problems
> https://bugs.launchpad.net/bugs/587409
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Nick Ames (nickames0) wrote :

I had the exact same problem trying to print to an Imagewriter II serial printer. Dave Gilbert's fix worked perfectly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.