From owner-freebsd-questions@FreeBSD.ORG Fri Jul 18 12:07:05 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A2A7F86 for ; Fri, 18 Jul 2014 12:07:05 +0000 (UTC) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2212BD8 for ; Fri, 18 Jul 2014 12:07:04 +0000 (UTC) Received: from r56.edvax.de (port-92-195-69-249.dynamic.qsc.de [92.195.69.249]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 507C53CDFF; Fri, 18 Jul 2014 14:06:56 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id s6IC6tQM001938; Fri, 18 Jul 2014 14:06:55 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Fri, 18 Jul 2014 14:06:55 +0200 From: Polytropon To: Beeblebrox Subject: Re: printcap configuration problem Message-Id: <20140718140655.27e43ebb.freebsd@edvax.de> In-Reply-To: <1405676044178-5929730.post@n5.nabble.com> References: <1405676044178-5929730.post@n5.nabble.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 12:07:05 -0000 On Fri, 18 Jul 2014 02:34:04 -0700 (PDT), Beeblebrox wrote: > Hi. > > Cups has been borked for some time, so I must use lpd. Several problems when > configuring /etc/printcap however. So far what I have: > > 1 HP2100tn:rm=192.168.1.9:rp=RAW1:\ > 2 :sd=/var/spool/lpd/hp2100:lf=/var/log/lpd-errs:\ > 3 :if=/usr/local/libexec/lf2crlf:\ > 4 :mx#0:sh: > > The Problems: > * Line 1 fails completely with "lpr: lp: unknown printer" when using any > name other than "lp". Tried: > NO: HP2100tn:lp=9100@192.168.1.9:rm=HP2100tn:\ > NO: HP2100tn:lp=9100@192.168.1.9:\ > WORKS: lp:lp=9100@192.168.1.9:rm=HP2100tn:\ > WORKS: lp:rm=192.168.1.9:rp=RAW1:\ This sounds normal. If no printer is given, "lp" is the name that will be addressed. It is the _default_ printer name that the lp* tools refer to. If your printer is named differently, you need to specify -P according to the printcap entry. You can also define $PRINTER (for example in /etc/csh.cshrc globally) with the name of the printer. For example, I have this setting (among others): Laserjet|ljet4d;r=600x600;q=high;c=full;p=a4;m=auto:\ :rm=192.168.100.100:\ :rp=raw:\ :lp=:\ :if=/opt/libexec/ps2pcl-dup.sh:\ :sd=/var/spool/lpd/Laserjet:\ :lf=/var/spool/lpd/Laserjet/log:\ :af=/var/spool/lpd/Laserjet/acct:\ :mx#0:\ :sh: It's my default printer, so I set $PRINTER to "Laserjet", and when I invoke lpr, lpq or lprm, this printer's queue will be used. For my nondefault printers, I have to use # lpq -PLaserjet-nodup for example, but I hardly do this. :-) In your case, $PRINTER would have to be set to "HP2100tn", or you use -PHP2100tn (at least for testing). > * I need to specify below options. Placing in /etc/printcap (line 1) as > lp;r=300x300;q=draft;c=gray;p=a4;m=auto:\ > :rm=192.168.1.9:rp=RAW1:\ > results in the same "unknown printer" error. I need to either find the > correct syntax for printcap [...] See "man printcap" for this. > [...] or I could modify /usr/local/libexec/lf2crlf, > which has: > #!/bin/sh > CR=$'\r' > /usr/bin/sed -e "s/$/${CR}/g" > > ## will A4 size info here work? > #page_width= > #page_height= > #border= > > Printer: HP LaserJat 2100, PS-level-2 A Postscript printer? Excellent, this should work without any problems. But I don't see how modifying the printer filter should help... Anyway, consult http://www.wonkity.com/~wblock/docs/html/lpdprinting.html for more helpful advice. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...