print/hplip and 8.0-BETA2
Paul Mather
paul at gromit.dlib.vt.edu
Mon Aug 10 16:15:10 UTC 2009
I am trying to get print/hplip working under FreeBSD 8.0-BETA2. I
think the problem boils down to a permissions problem, but I don't
know for certain if it lies with hplip (hpssd) or CUPS. I am inclined
to believe the former, and was wondering if there was an easy way to
have hpssd run as user "cups"; right now it runs as user "nobody".
FreeBSD 8 has a new USB implementation. One of the changes from
FreeBSD 7 and earlier is that the devices have moved around under /
dev. In particular, there is now a /dev/usb directory under which the
actual USB devices live. Devices like /dev/ugenX.Y are symbolic links
pointing to the corresponding device in /dev/usb, e.g., usb/X.Y.0.
My first problem, therefore, was following the devfs.rules notice
instructions in the pkg-message for print/hplip, in particular the
following line:
add path 'usb*' mode 0660
I realised this should be more like the following on FreeBSD 8:
add path 'usb' mode 0770
add path 'usbctl' mode 0660
which preserves the "x" permission on the /dev/usb directory. Doing
this silenced these incessant errors in my logs when trying to print a
test page from CUPS:
Aug 10 11:04:17 chumby DeskJet_960C?serial=MY13R1D1NCRO: io/hpmud/
musb.c 1059: unable to open hp:/usb/DeskJet_960C?serial=MY13R1D1NCRO
Aug 10 11:04:17 chumby DeskJet_960C?serial=MY13R1D1NCRO: prnt/backend/
hp.c 636: INFO: open device failed; will retry in 30 seconds...
However, I then got this repetitive error:
Aug 10 11:05:52 chumby DeskJet_960C?serial=MY13R1D1NCRO: io/hpmud/
musb.c 977: bulk_write failed buf=0x9fbfca14 size=8192 len=-60:
Permission denied
Aug 10 11:05:52 chumby DeskJet_960C?serial=MY13R1D1NCRO: io/hpmud/
musb.c 1337: unable to write data hp:/usb/DeskJet_960C?
serial=MY13R1D1NCRO: 45 second io timeout
I notice that hpssd (which appears to be logging these errors) runs as
user "nobody":
chumby# ps augx |grep hps
nobody 36637 0.0 0.7 17304 11156 ?? S 11:09AM 0:00.04 /
usr/local/bin/python /usr/local/sbin/hpssd
And, indeed, altering the USB device permissions to allow RW access
for everyone eliminated the above "Permission denied" and "unable to
write data" errors in the log and allow CUPS to print.
The documentation at http://am-productions.biz/docs/hplip.php doesn't
seem to have been updated in some time. It mentions a "hpiod_user"
rc.conf setting to allow hpiod to run under a different user, but the
current print/hplip port no longer uses hpiod.
The help for hpssd doesn't list an option to run under a different
user. Is there some way to do this (e.g., user "cups", so I can
revert the permissions on my USB devices), or am I looking in the
wrong place and the problem lies with CUPS or the foomatic filters?
Any help is appreciated. (Please Cc: me on replies as I am not
subscribed to this mailing list.)
Cheers,
Paul.
More information about the freebsd-ports
mailing list