From owner-freebsd-questions@freebsd.org Sun Sep 13 12:23:32 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C60AA02621 for ; Sun, 13 Sep 2015 12:23:32 +0000 (UTC) (envelope-from freebsd@edvax.de) 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 B81171486 for ; Sun, 13 Sep 2015 12:23:31 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-125-111.dynamic.qsc.de [92.195.125.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 61AEF3CEC0; Sun, 13 Sep 2015 14:23:22 +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 t8DCNLLK003793; Sun, 13 Sep 2015 14:23:21 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sun, 13 Sep 2015 14:23:21 +0200 From: Polytropon To: Bernt Hansson Cc: reg@dwf.com, freebsd-questions@freebsd.org Subject: Re: Still having network/Postscript Printer problem Message-Id: <20150913142321.293c85e2.freebsd@edvax.de> In-Reply-To: <55F564D6.3090106@bananmonarki.se> References: <201509130653.t8D6rLr8006399@deneb.dwf.com> <55F564D6.3090106@bananmonarki.se> 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 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2015 12:23:32 -0000 On Sun, 13 Sep 2015 13:58:14 +0200, Bernt Hansson wrote: > On 2015-09-13 08:53, reg@dwf.com wrote: > > I am having nothing but trouble in trying to get printing to work under > > FreeBSD with my HPLJ4100. The printer works find from linux, and I might > > just give up and use the 'cups' implemenetation under FreeBSD if I can't > > get lpd to work. > > > > Here is where I stand. > > > > I have the environment variabalee > > > > setenv PRINTER=HPLJ4100 > > Remove the equal sign. The correct C shell syntax is setenv PRINTER HPLJ4100 Make sure to check if % echo $PRINTER reflects that setting. You can make it global by adding that line to /etc/csh.cshrc. > > dns sees the printer > > > > % nslookup HPLJ4100 > > Server: 127.0.0.1 > > Address: 127.0.0.1#53 > > > > Non-authoritative answer: > > Name: HPLJ4100.dwf.com > > Address: 192.168.64.30 Good. > > I have > > > > lpd_enable="YES" > > > > in /etc/rc.conf > > > > I have set > > > > service lpd start > > > > numerous times, and lpd is running. Good. > > my printcap keeps changing, but currently reads > > > > HP-DP:\ > > :rm=9100@HPLJ4100:\ > > :rp=raw:\ > > :sd=/var/spool/lpd/HP-DP:\ > > :lf=/var/spool/lpd/HP-DP/log:\ > > :af=/var/spool/lpd/HP-DP/acct:\ > > :mx#0:\ > > :sh: > > > > when I do a > > > > lpr sum.ps > > > > of a postscript file, I see > > > > root@FreeBSD:/home/reg # lpr sum.ps > > lpr: HPLJ4100: unknown printer So lpr cannot find "lp" (the default printer) or has trouble finding the one set by $PRINTER (maybe because it never interitet the environmental setting?). When you manually use the -P option to the lp* commands, it should work: # lpq -PHPLJ4100 This also works for lpr or lprm. > > if I take the 9100@ out of the printcap file, viz > > > > HP-DP:\ > > :rm=HPLJ4100:\ > > :rp=raw:\ > > :sd=/var/spool/lpd/HP-DP:\ > > :lf=/var/spool/lpd/HP-DP/log:\ > > :af=/var/spool/lpd/HP-DP/acct:\ > > :mx#0:\ > > :sh: > > > > I see for the lpr > > > > root@FreeBSD:/home/reg # lpr sum.ps > > lpr: HPLJ4100: unknown printer > > > > so thats the same. No, it's a little different, but shows something: $PRINTER is set, but it does not have a corresponding entry with that name in the printer capability file, as it seems. Look closely: The symbol for the printer definition is "HP-DP" (line 1), and "HPLJ4100" (line 2) is the _host name_ of the printer - it could be its IP as well. You need to set $PRINTER to the printer definition name. setenv PRINTER HP-DP and similarly # lpq -PHP-DP That is the conflict of "printer not found" you're seeing: You are trying to print to a printer that does not exist. > > I have tried about a thousand vaiations, anc always see > > > > root@FreeBSD:/home/reg # lpq > > lpq: printer not found > > > > I must be doing something basic that is wrong, but I dont see ir. > > Someone tell me what Im doing wrong, this can't be this hard. Definitely. Printing on FreeBSD ususlly is very easy, especially when you have a _real_ printer as you do. Regarding the "rm= vs. lp=" question, "man 5 printcap" says: lp str /dev/lp device name to open for output, or port@machine to open a TCP socket rm str NULL machine name for remote printer So using lp= should be perfectly fine. If I remember correctly, you can even omit the port number. I haven't specified it anywhere, and the printer still works. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...