TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:7538] printing (lpr/lpd?) problems



> Hello, i'm new to this list; I just joined up after coming to the
> meeting last weekend. Hopefully someone here can help me with a
> problem I'm having.

Welcome to the list!  We're happy to have you here!  The more people on
the list, the better the possibility we can solve eachother's problems!

>         We bought a new accounting application, and I convinced the
> boss to get OSAS 6.0 for Linux. I'm installing it on a RedHat5.1
> server, and attempting to print to a HP LaserJet 4V via a JetDirect
> network card.

Ooohhh...  JetDirect!  The uber printer server! :)

>         our accounting app won't print reports. (in most cases).
> screens will print (there's a sort of print-screen function included
> in the program); but reports tend to go into the print spooler, and
> jam up in there, refusing to print.

Ok.  What are you using as your print spooler?  lpd?  lprng?  What does
your printcap look like?  We're using Lpr for Linux version 0.33, the
debian package.  It seems to work fine for us using the Jet Direct cards
for both the HP 4000's and HP 5 that we use here.  Our printcap for
printing to an HP printer is:

hp4k-comp:\
        :lp=/dev/null:\
        :sd=/var/spool/lpd/hp4k-comp:\
        :rm=192.168.1.31:\
        :rp=raw:\
        :sh:

>         our consultant could get reports to print, when he was logged
> in with Windows Telnet. however, when he logged in with TinyTerm, it
> wouldn't work. I poked around with terminal emulations, and actually
> got a report to print once; I think it's because I was using vt100
> emulation. (however, I haven't been able to repeat that since)

Um...ok...  I would imagine this may be a problem if your program prints
the report to standard output rather than sending it to a specified
printer.  Does the report "scroll by" when you try to print it?  If it
does, then I think your software may be a little behind the times...

>         when the jobs are stuck in the print queue i can see that
> they're printing from "standard input"; which is one of the reasonsi'm
> suspecting the problem has something to do with the terminal
> emulation. (the program seems to be too stupid to readily recognize
> networked printers; so in order to print to one, you need to use
> something like "> lpr -P hp4v -s 2>/dev/null" rather than '/dev/lp1')

Why would you try to print to a device unless the printer were attached
directly to the computer?  Even then, why are you specifying a device?  
If you specify the printer name and are using the lpr command (which means
you're running lpd), you should need to specify the device.  These
specifications should be found in your /etc/printcap.  Notice in the
printcap I provided, the "lp=/dev/null" statement is telling LPD that this
printer is not located locally and that all such info should be sent to
null.  The "rm=<ip address>" tells LPD to send the file to the remote
printer server and print to the "raw" printer ("rp=raw").  (You cannot
filter to remote printers with the standard LPD or LPRNG -- although that
is being worked on, so you shouldn't have any "if" statements.)

> anyone got a clue what to try next? if I can upgrade RH5.1 to 6.0
> without damaging anything in the process, would that help? (never done
> a Linux upgrade myself; nor do I know anything about how smooth they
> are).

Well, first things first.  Make sure your printer works.  Sit down on the
Linux machine and log in.  Prove to yourself that you can print from your
console to the remote printer first.

	lpr -P <printer> <file>

If that doesn't work, make sure your printcap is set up correctly.  Make
sure the ownership of the spool directories is lp and group lp.

	chown lp.lp /var/spool/lpd/<spool directory>

If you're using a JetDirect card and your printer is attached to the
network (and not the linux machine), don't try to print to an lp device
(lp0,lp1).  It WON'T work.

Make sure lpd is running...

	ps awx | grep lpd

If it isn't, start it up.  More than likely, there'll be a script in the
/etc/init.d/ directory called lpd.  Start or restart the server (reload it
if you have changed the printcap).

	/etc/init.d/lpd {start|stop|restart|reload|force-reload}

If lpd's running, and you don't get errors trying to print the file, use
lpc or lpq to check the printer status and cue.  You can actually restart
a single printer from lpc without having to restart the lpd service...

> if anyone has a working fix for this; i'm sure I can get them paid as
> a 'consultant'.

Well, if you can't get this working on your own after you try some of this
out, give the list another buzz.  Someone's bound do have a little free
time (myself included).

After all of this testing, let's say you find that you can successfully
print ascii text to the printer (it may not look pretty, but it'll print).
Try printing a postscript file to the printer (if the HP 4V supports
postscript).  Let's say it all works.  Make sure you don't specify a
device name for your printer in the report software configuration file.
I'd say just specify by the printer name itself.

I hope this helps.

^chewie

Chad Walstrom
1-888-960-6821