lpd/lpr broken? (/etc/printcap)

lpd/lpr broken? (/etc/printcap)

Post by ad.. » Wed, 11 Jan 1995 23:21:48



I've been trying for the better part of two days to configure a remote
printer on my Linux 1.1.59 slackware system, and am getting nowhere.  It
appears as though the :if: filter is never executed regardless of what
I do.  I built an /etc/printcap file that looks like:

lp|NEC Mod 95:\
:sh:\
:mx#0:\
:lp=/dev/m200.com1:\
:sd=/var/spool/lp1:\
:if=/var/spool/lp1/filter1:

(Note: the lp=/dev/m200.com1 line is intended to have all print output
stuffed in this file.  I created it with touch, chmod 777. Just trying
to save paper during testing.)

where the filter1 file looks like:

#!/bin/sh
/bin/touch /var/spool/lp1/f1

The f1 file is never created by touch from this last line above.
The /var/adm/messages and syslog do not provide any feedback.  The spool
directory exists, and permissions are generous.  The lpr/lpd permissions
and ownerships all appear to be valid.

Has anyone seen problems like this before?  Any help would be greatly

Thanks...
Rich Adamson

 
 
 

lpd/lpr broken? (/etc/printcap)

Post by Master of Wond » Wed, 01 Feb 1995 02:35:53


I was playing with this just the other day.  My belief is that
you cannot redirect output to a nonexistant device (in your case
it would be /dev/m200.com1).  Despite what they taught you in
school, files are not the same as devices.  Take a look at the
example myprinter script, its how I got my stuff going here.

This is my input filter.  The device used is irrelevant (try /dev/null),  
if you want to redirect output to a file.   To do so, redirect it within the
filter.   For example, "cat >> /tmp/output" should put output in /tmp/output.

#!/bin/sh
# Filter for HP printers to treat LF as CRLF
# the ``echo -ne'' assumes that /bin/sh is really bash
echo -ne \\033\&k2G
cat
echo -ne \\f

Works for me!

-  Andy


> I've been trying for the better part of two days to configure a remote
> printer on my Linux 1.1.59 slackware system, and am getting nowhere.  It
> appears as though the :if: filter is never executed regardless of what
> I do.  I built an /etc/printcap file that looks like:

> lp|NEC Mod 95:\
> :sh:\
> :mx#0:\
> :lp=/dev/m200.com1:\
> :sd=/var/spool/lp1:\
> :if=/var/spool/lp1/filter1:

> (Note: the lp=/dev/m200.com1 line is intended to have all print output
> stuffed in this file.  I created it with touch, chmod 777. Just trying
> to save paper during testing.)

> where the filter1 file looks like:

> #!/bin/sh
> /bin/touch /var/spool/lp1/f1

> The f1 file is never created by touch from this last line above.
> The /var/adm/messages and syslog do not provide any feedback.  The spool
> directory exists, and permissions are generous.  The lpr/lpd permissions
> and ownerships all appear to be valid.

> Has anyone seen problems like this before?  Any help would be greatly

> Thanks...
> Rich Adamson



 
 
 

lpd/lpr broken? (/etc/printcap)

Post by Joe Han » Fri, 03 Feb 1995 22:19:33



: I was playing with this just the other day.  My belief is that
: you cannot redirect output to a nonexistant device (in your case
: it would be /dev/m200.com1).  Despite what they taught you in
: school, files are not the same as devices.  Take a look at the
: example myprinter script, its how I got my stuff going here.

: > I've been trying for the better part of two days to configure a remote
: > printer on my Linux 1.1.59 slackware system, and am getting nowhere.  It
: > appears as though the :if: filter is never executed regardless of what
: > I do.  I built an /etc/printcap file that looks like:
: >

The problem here is that the ":if=" script does NOT get run if the
printer is remote.  The solution is to create a "pseudo" local printer
which has :lp=/dev/null and have it's :if= script do whatever processing
you need and THEN respool it's output to the real remote printer.

--
-------------------------------------------------------
Joe Hance                         Mentor Graphics Corp.


-------------------------------------------------------

 
 
 

1. Unusually complex/exotic lpr, lpd, printcap games & fun...

First of all I am quite familure with RedHat's printtool and the 'magic
filter' games.  I have a Cannon BJ330 printer.  This is a *wide
carriage* pin-feed (I have a sheet feeder also) ink-jet printer.  I have
it running in Epson emulation mode.  It behaves like a 24-pin Epson
printer.  I have everything setup and working fine with GS 5.10 (under
RH 5.2).  There are some special things *I* want to do, however, and I
am not sure how to do them.

I do two *main* kinds of printing (at present): PostScript on normal
letter sized paper (8.5x11) and non PostScript printing on wide pin-feed
(continuous) paper (I presently have some paper that is 14+" wide, by
8.5" between perfs. -- yes, 'short' pages, but you get 68 lines/page at
8 lpi (the printer has an '8 lines per inch' mode).  At present the
normal setup works just fine.  I manually switch the printer's feed
source and manually 'sync' what I print with how the printer is set up.

The normal print filter includes the option '-papersize=LETTER' on the
gs command line, which at present is ok, BUT I want to do some special
things:

I'd  like to print on 'strange' sized paper sometimes.  I am not sure if
I should edit /usr/share/ghostscript/5.10/gs_statd.ps or if there is a
better way to deal with strange sizes.

I'd like to have filters in place for several different paper sizes at
the same time (randomly editing or having way too much fun with mv/ln
is something I'd like to avoid), and somehow specify on the lpr command
which filter / filter options to use.  I'm thinking: I could set up
several queues all feeding the same device,  but I am not sure if that
will create a mess (lock and queue management nastiness).  Is lpr/lpd
too dumb to handle this sort of reality or is there a 'smart' lpr/lpd
replacement available?  I could probably create a 'smart' lpr/lpd
package that supported the extra options -- would anybody else even be
interested in such a beast?  Note: there might not be any way to tell
*from the tile itself* what options it would want (although peeking for
%%PageSize or %%DocumentMedia, etc. options might be possible, these
might not be there or be meaningful sometimes).

--
                                     \/


http://www.deepsoft.com              /\FidoNet:    1:321/153

2. Top 10 subjects comp.unix.shell

3. Cannot print : no lpr, printcap, lpd ....

4. hammer: MAP_32BIT

5. lpr and /etc/printcap problem.

6. rpm compiling

7. I'm looking for an lpr which bypasses /etc/printcap

8. Please Someone HELP ME!!!!!!!!!!!

9. Need lpd /etc/printcap help

10. lpd misreads COMMENTS in /etc/printcap ???

11. Missing lpd,lpc,lpr etc (Slackware Linux installation)

12. lpr, lpd, lpc etc in slackware 3.1

13. Setting up lpd, lpr, etc.