From owner-freebsd-questions@FreeBSD.ORG Sat Apr 25 05:05:29 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EFDC106567D for ; Sat, 25 Apr 2009 05:05:29 +0000 (UTC) (envelope-from gnemmi@gmail.com) Received: from mail-qy0-f105.google.com (mail-qy0-f105.google.com [209.85.221.105]) by mx1.freebsd.org (Postfix) with ESMTP id 5183F8FC20 for ; Sat, 25 Apr 2009 05:05:29 +0000 (UTC) (envelope-from gnemmi@gmail.com) Received: by qyk3 with SMTP id 3so2994057qyk.3 for ; Fri, 24 Apr 2009 22:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:cc:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=ITw6SJdIwW5LjgaMUTgroR7YU7IbfhURjqgO7xGmFFQ=; b=VzIKyS/JoGmPdhJ+o4nZDwiiBe6luoUFVGZSMhqjKiFk0uQ9uyRVgTRd3VaLIHZRaF iAdKdKrLGZQQ8CC0OtUTF+5FcVji/3qWG1MwjRiHN5b9rL+kt8WMNJe2StbIe3n19Aez th83d7h/LIh+la78E+HDbfZ6BsOgT1SCosyuc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:cc :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=VrLoNZtB7A9VPpwUrvOiS9RlTvxrNty8Bhi9KYXR2TCq9aNTIf4w1d05H+qsJk4r4m rAr5M5xeQ0dBIl3yd6KvNJwSC91lP5Rqmh93EgmouFQyG89b9YNjzmaDjQ99EWVVo2pv cOHGyY9gmxZzj4A97DGkKJ839fdE1eem2kMJM= Received: by 10.224.80.134 with SMTP id t6mr3785330qak.173.1240635928560; Fri, 24 Apr 2009 22:05:28 -0700 (PDT) Received: from ?192.168.1.100? ([190.177.204.60]) by mx.google.com with ESMTPS id 26sm3322487qwa.26.2009.04.24.22.05.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 24 Apr 2009 22:05:27 -0700 (PDT) From: Gonzalo Nemmi To: freebsd-questions@freebsd.org Date: Sat, 25 Apr 2009 02:05:25 -0300 User-Agent: KMail/1.9.10 References: <20090420145839.5D396A3DC7@maxine.cjones.org> In-Reply-To: <20090420145839.5D396A3DC7@maxine.cjones.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904250205.25537.gnemmi@gmail.com> Cc: weif@weif.net Subject: Re: Can you ACTUALLY print from FreeBSD? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2009 05:05:30 -0000 On Monday 20 April 2009 11:58:39 am Keith Seyffarth wrote: > I'm trying to print from my FreeBSD machine. I've been through a > number of online tutorials and instructions on printing from Unix or > FreeBSD in particular, but they all seem to start with the assumption > that printing from the machine is possible. I'm trying to get to that > starting point. > > I have installed: > > cups-base-1.3.9_3 Common UNIX Printing System > cups-pdf-2.5.0 A virtual printer for CUPS to produce PDF files > cups-pstoraster-8.15.4_2 Postscript interpreter for CUPS printing to > non-PS printers gutenprint-cups-5.1.7_3 GutenPrint Printer Driver > libgnomecups-0.2.3_1,1 Support library for gnome cups admistration > hplip-2.8.2_4 Drivers and utilities for HP Printers and > All-in-One device > > The printer I'm working with is a HP Officejet 4110. Hello Keith ! Ok .. first and to answer the topic: Yes, I can, and it has been that way since day 1 with FreeBSD in here. Your printed seems to be supported by hplip ... http://hplipopensource.com/hplip-web/models/officejet/officejet_4100_series.html > There seem to be several issues with printing. First, since this is a > USB printer, And so it's mine (an Hp LaserJet 1015) > the pinter is always owned by root:operator with read > permissions for user, group, and world. > Adding these lines to /etc/devfs.conf > link ulpt0 printer > own ulpt0 cups:cups > perm ulpt0 0666 Maybe you should have taken a look at the hplip post install message ... Here, take a look at this: [gonzalo@inferna ~]% pkg_info -xD hplip Information for hplip-2.8.2_3: Install notice: ********************************************************** **************** UPGRADE FROM 1.X NOTICE ***************** NOTE: If you are upgrading from 1.x you will need to change your devfs ruleset as hpiod is now gone, so remove it from you rc.conf. The printer communication now runs through cupsd. You will need to make the devfs ruleset changes to allow cups to access the usb bus and ugen devices so that it can enumerate the printers. You will also need to update your hplip.conf. See the instructions below. **************** UPGRADE FROM 1.X NOTICE ***************** Add the following to your rc.conf: hpssd_enable="YES" So all you have to do if you have a custom ruleset setup is add the following to that ruleset in devfs.rules: add path 'usb*' group cups add path 'usb*' mode 0660 add path 'ugen*' group cups add path 'ugen*' mode 0660 If you have never setup devfs.rules please read the manpage and see: http://am-productions.biz/docs/devfs.rules.php The printer MUST attach as a ugen(4) device. This means that you must NOT have "device ulpt" in your kernel and ulpt must NOT be loaded as a kernel module. If you are seeing device connection errors restart the printing chain with the following command. NOTE: It MUST be restarted in the stated order. %%PREFIX%%/etc/rc.d/hpssd restart && \ %%PREFIX%%/etc/rc.d/cupsd restart If upgrading from a version < 2.7.9 copy the new hplip.conf.sample config. cp %%PREFIX%%/etc/hp/hplip.conf.sample \ %%PREFIX%%/etc/hp/hplip.conf If you are still having problems check: http://am-productions.biz/docs/hplip.php If you are still having problems send the relevant part of your /var/log/messages, console output from the hp-* utility that you are trying to run, and your rc.conf + devfs.rules files and the output of "ls -l /dev" to the maintainer. ********************************************************** [gonzalo@inferna ~]% So .. basically .. get rid of "ulpt" ... recompile your kernel if you have to, but get rid of it .. the printer MUST attach as a ugen(4) device ... Plug your printer in, turn it on and .. add this lines to devfs.rules (change the "[system=10] " to suit your needs if you have to) [system=10] add path 'usb*' group cups add path 'usb*' mode 0660 add path 'ugen*' group cups add path 'ugen*' mode 0660 after that, issue the following commands: cp /usr/local/etc/hp/hplip.conf.sample /usr/local/etc/hp/hplip.conf /etc/rc.d/devfs restart /usr/local/etc/rc.d/hpssd start /usr/local/etc/rc.d/cupsd start log in to the cups config page and follow the steps to configure your printer ... when prompted for a printer URI, make use of hp-makeuri to determine what URI you should use .. I use it like this: hp-makeuri printer_serial_number and it will return something along this way: hp:/usb/hp_LaserJet_1015?serial=MYSERIALGOESINHERE feed that to the URI field and then move on to choose the ppd file which you'll be able to find under /usr/local/share/ppd/HP ... And that's about it .. > will set the ownership to cups:cups and the permissions to read and > write for user, group, and world on startup if the printer is already > turned on and plugged in. However, if the printer is not turned on at > startup, or if it is disconnected or turned off after system startup, > ownership and permissions revert. > > Trying chown or chmod to the device at /dev/ulpt0 gives an invalid > path error, and trying to do so following the instructions in the man > page for devfs give 'operation not supported by device' errors. > > When th device is owned by root, attempting to print the test page > generates a 'permission denied' error in CUPS. When the device is > owned by cups, attempting to print the test page generates a "failed" > error in CUPS. As mentioned in the after install notes, forget ulpt ... hplip needs the printer attached using ugen. ultp shouldn't even be loaded in the kernel as a module ! > When the device is owned by cups, this error is reported in the error > log in CUPS, if debug logging is enabled: > > [CGI] /usr/local/share/cups/drivers/pscript5.dll: No such file or > directory > > There isn't a drivers directory in /usr/local/share/cups. I can make > one, but where do I get the pscript5.dll, and what else is it going > to rely on? > > CUPS et al were installed using portinstall, and CUPS is working well > to produce .pdf files. I tried portupgrade last night on all the (I > think) relevant ports, but the system thinks they are all up to date. > > So, questions: > > 1. how can I get permissions on the device to stick, so that I do not > have to reboot the machine every time we want to print or have to > power cycle the printer? Add this lines to devfs.rules (change the "[system=10] " to suit your needs if you have to) [system=10] add path 'usb*' group cups add path 'usb*' mode 0660 add path 'ugen*' group cups add path 'ugen*' mode 0660 then issue the following command: /etc/rc.d/devfs restart > 2. Am I correct that the missing .dll (that seems awfully Windows to > me) is the problem in getting a filter to print? If so, what do I > need to do to install it? You shouldn't need any dll at all .. : [gonzalo@inferna ~]% ls /usr/local/share/ppd/HP/ | grep officejet_4100 | sort hp-officejet_4100_series-hpijs.ppd.gz that's all you need ... > And, actually, a third printing-related issue: How do I get cupsd to > start on startup? I have these two lines in /etc/rc.conf:\ > cupsd_enable="YES" # enable cups printing management > devfs_system_ruleset="system" # something else they say cups needs I have this three lines on my /etc/rc.conf file: devfs_system_ruleset="system" hpssd_enable="YES" cupsd_enable="YES" > but CUPS has to be manually started by root after each reboot. what > else needs to be done to get cupsd to start at startup? After adding those lines to your /etc/rc.conf file .. theoretically .. nothing ... hpssd and cupsd should be enabled by default on every boot .. > > Keith Hope that helps ! Kind regards :) -- Blessings Gonzalo Nemmi