ports/119641: cups requires ownership of printer device but port has no example devd.conf entry
Andrew Reilly
areilly at bigpond.net.au
Sun Jan 13 23:20:01 UTC 2008
>Number: 119641
>Category: ports
>Synopsis: cups requires ownership of printer device but port has no example devd.conf entry
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: doc-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Jan 13 23:20:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Andrew Reilly
>Release: FreeBSD 7.0-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD duncan.reilly.home 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #7: Sat Jan 12 11:03:22 EST 2008 root at duncan:/usr/obj/usr/src/sys/DUNCAN amd64
Machine is a P-III/500 with 512M RAM and a usb-attached
Lexmark E312-PS laser printer
>Description:
The CUPS print driver runs as user:group cups:cups, and
so requires read/write access to the chosen printer
device as such. This doesn't happen by default, and
it probably isn't clear to the newbie how to ensure that
things are set up with the correct ownership and
permissions.
This problem is compounded for printers that are
usb-attached (via ulpt0...), because the ulpt0 device
comes and goes from the system whenever the printer is
turned on or off (as it often is in low-use, home-office
situations like mine).
What makes it even trickier, is that there seem to be
two mechanisms for adding policy regarding devices:
devd.conf and devfs.conf. Devfs.conf is the only one of
the two that has examples that include ownership
changing, but it turns out that this is *not* the
appropriate file to configure, because the devfs.conf
rules are only applied at boot time, when devfs is
mounted. Devd.conf is the correct place (or rather,
/usr/local/etc/devd/ in this case) to make this tweak,
but there is no appropriate example in the standard
config file.
>How-To-Repeat:
Install cups from port.
Use the web admin interface to set up a printer at
/dev/ulpt0.
Turn the printer off.
Turn the printer back on.
Try to print something, and watch the cups status show
that the printer is borked.
>Fix:
Have the cups installation install something like the
following, either directly in
/usr/local/etc/devd/ulpt.conf (where I've put it) or in
some example file that the installer's attention is
drawn to by the port message.
attach 110 {
device-name "ulpt[0-9]+";
action "chown cups:cups /dev/$device-name";
};
It occurs to me that this fault (or something like it)
might also occur for lpd, but I don't use that, so don't
know for sure.
Also: re general doc/Handbook: there is no reference to
devd.conf in the handbook (according to a google
search), other than indirectly through a devd(8)
man-page link deep inside the bluetooth section. It
would be nice if there was a bit more of a tutorial
available on it, particularly since pluggable devices
are becoming more common all the time. The manual page
is well-written and complete, but the syntax is kind of
curly, and without matching examples, it can be tricky.
For example, the first go at this fix I didn't include
the semicolon after the closing brace, and the error
message confusingly talked about the line *after* the
last line in the file. The second and third attempts
didn't have "/dev/" in front of $device-name, because I
hadn't grocked that $device-name didn't already include
that (none of the other examples in /etc/devd.conf
explicitly refer to the device file like this).
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list