Still having network/Postscript Printer problem

Polytropon freebsd at edvax.de
Sun Sep 13 12:23:32 UTC 2015


On Sun, 13 Sep 2015 13:58:14 +0200, Bernt Hansson wrote:
> On 2015-09-13 08:53, reg at 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 at 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 at 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 at 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 at 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 at 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, ...


More information about the freebsd-questions mailing list