From owner-freebsd-questions@FreeBSD.ORG Wed Feb 2 20:35:40 2011 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 C65F5106564A for ; Wed, 2 Feb 2011 20:35:40 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 863308FC18 for ; Wed, 2 Feb 2011 20:35:40 +0000 (UTC) Received: from r55.edvax.de (port-92-195-143-131.dynamic.qsc.de [92.195.143.131]) by mx01.qsc.de (Postfix) with ESMTP id 13E933D10B; Wed, 2 Feb 2011 21:35:38 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id p12KZcxG001588; Wed, 2 Feb 2011 21:35:38 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Wed, 2 Feb 2011 21:35:37 +0100 From: Polytropon To: Bahman Kahinpour Message-Id: <20110202213537.18134b47.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Using foo2zjs filter without CUPS (with FreeBSD's standard LPD instead) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2011 20:35:40 -0000 On Wed, 2 Feb 2011 22:24:42 +0330, Bahman Kahinpour wrote: > Hello, > > I have a HP LaserJet P1102 printer and I managed to get it working > with CUPS and "foo2zjs" filter from foo2zjs.rkkda.com. I am interested > in removing the CUPS and using the native LPD system of FreeBSD. But I > have a question. > > What command should I specify as "if" Input Filter or "of" Output > Filter in the /etc/printcap file for using it with LPD and foo2zjs > filter? Something like this (not tested) should work: p1102:HP LaserJet P1102:sh:lp=/dev/ulpt0:sd=/var/spool/lpd/p1102:lf=/var/log/lpd:if=/opt/bin/filter-p1102 Then /opt/bin/filter-p1102 is where the printer filter resides. In "my" nomenclature, /opt is for everything that is not managed by the ports or by the system. Maybe you chose a better location, e. g. /etc/filter-p1102 or /usr/local/filters/filter-p1102, just as you like. Also make sure the spool directory and the log file do exist. The file filter-p1102 itself is just a shell script. It works as a wrapper for your foo2 filter, foo2zjs in your case: #!/bin/sh export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin /usr/local/bin/foo2zjs-wrapper It reads from stdin and outputs to stdout, and this mechanism is embedded in lpd's processing chain, as far as I understood. > The point is that I am sure it will work with foo2zjs and LPD as > /dev/ulpt0 is recognized and works fine and I may simply use that as > output port and there is nothing CUPS-dependent in foo2zjs. True. Get rid of the CUPS monster and use the excellent system tools to do this simple job. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...