From owner-freebsd-ports@FreeBSD.ORG Mon Aug 10 16:15:10 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E7D0106567A for ; Mon, 10 Aug 2009 16:15:10 +0000 (UTC) (envelope-from paul@gromit.dlib.vt.edu) Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.162.213]) by mx1.freebsd.org (Postfix) with ESMTP id E88AC8FC1A for ; Mon, 10 Aug 2009 16:15:09 +0000 (UTC) Received: from steiner.cc.vt.edu (steiner.cc.vt.edu [198.82.163.51]) by lennier.cc.vt.edu (8.13.8/8.13.8) with ESMTP id n7AG3VZ1011938 for ; Mon, 10 Aug 2009 12:03:31 -0400 Received: from auth3.smtp.vt.edu (EHLO auth3.smtp.vt.edu) ([198.82.161.152]) by steiner.cc.vt.edu (MOS 4.1.7a-GA FastPath queued) with ESMTP id ATK48063; Mon, 10 Aug 2009 12:03:31 -0400 (EDT) Received: from gromit.tower.lib.vt.edu (gromit.tower.lib.vt.edu [128.173.51.22]) (authenticated bits=0) by auth3.smtp.vt.edu (8.13.8/8.13.8) with ESMTP id n7AG61Qc026598 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Mon, 10 Aug 2009 12:06:01 -0400 Message-Id: <1B96F138-1C1A-435B-BA05-F1AC449789C3@gromit.dlib.vt.edu> From: Paul Mather To: freebsd-ports@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Mon, 10 Aug 2009 12:03:30 -0400 X-Mailer: Apple Mail (2.935.3) X-Mirapoint-Received-SPF: 198.82.161.152 auth3.smtp.vt.edu paul@gromit.dlib.vt.edu 5 none X-Mirapoint-IP-Reputation: reputation=neutral-1, source=Fixed, refid=n/a, actions=MAILHURDLE SPF TAG X-Junkmail-Info: (0) X-Junkmail-Status: score=10/50, host=steiner.cc.vt.edu X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A020201.4A8044D3.017D,ss=1,fgs=0, ip=198.82.161.152, so=2009-07-29 21:33:33, dmn=2009-06-06 00:02:10, mode=multiengine X-Junkmail-IWF: false Subject: print/hplip and 8.0-BETA2 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 16:15:10 -0000 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.