Unix Technical Forum

lpr-2005 and input filters

This is a discussion on lpr-2005 and input filters within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> i posted the following on the debian_user group as that is where the lpr maintainer is, but it seems ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 05:39 PM
gobo20@lycos.com
 
Posts: n/a
Default lpr-2005 and input filters

i posted the following on the debian_user group as that is where the
lpr maintainer is, but it seems messages over there have to be
approved. so, allow me to ask here as i'm using slack10.2


pulled lpr-2005.05.01 from debian website and compiled it. it does
print, but i can't make it correctly handle input filters. the groups
have many disscussions on not being able to use input filters on
remote printers, so i tried to work with that as well and still no
luck.

below are my printcap entries. all my printers are network attached
in one way or another.

# hp 5 on lantronix mps-1
laser:\
:lp=:rm=192.168.1.101:rp=laser_text:\
:sd=/var/spool/lpd/laser:sh:

smallsys:\
:lp=/dev/null:\
:sd=/var/spool/lpd/smallsys:\
:if=/etc/smport:\
:sh:

ssa:\
:lp=rm=192.168.1.101:\
:rp=laser_text:\
:sd=/var/spool/lpd/ssa:\
:if=/etc/ssaport:\
:sh:

the smport filter:
#!/bin/sh
printf "\033(s12H" && cat | /usr/bin/lpr -Plaser && exit 0
exit 2


the ssaport filter:
#!/bin/sh
printf "\033(s12H" && cat && exit 0
exit 2


i'm not certain that the no-if-on-rm rule applies to both lpr and
lprng, and i can not find any reference to it in the source code.
pr test.txt | lpr -Psmallsys (or ssa) and looking at the stream
with tcpdump, i never see the escape codes.

here is where i'm real confused. the ssaport filter is not new,
it's still running on some boxes with lpr-048. also, the smport
filter is partially working because the output is redirected to
the laser queue, sans printf string.


does anyone have any thoughts on what i'm missing?

thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 05:39 PM
Sylvain Robitaille
 
Posts: n/a
Default Re: lpr-2005 and input filters

gobo20@lycos.com wrote:

> does anyone have any thoughts on what i'm missing?


My experience with lpr/lpd on commercial (mostly BSD-based) unixes is
that "if=" only applies to locally attached printers. The lpd you're
working with now is from BSD pedigree, so I'm sure it's mostly the same.

I have worked around that with some extensive hacking where I needed it,
but I don't think the resulting solution generalizes very well, or else
I'd give you a pointer to it. (on second thought, it might generalize
better than I think, so it may perhaps be worth my while to package it
up and provide a link to it, but it would be at least a few days before
I'll be even able to look at it, let alone package it).

The gist is to let lpd think the printer is locally attached, but have
the input filter call lprsend (from the BSD lpd) once it's done doing
whatever it does.

However, you say you've used your /etc/ssaport filter in the past with
an older lpd, and network-attached printers. Do you still have a system
around where that is working, so you can review the configuration? I
would guess that there's something that differs (perhaps only a little)
from what you're trying to do now ...

--
----------------------------------------------------------------------
Sylvain Robitaille syl@alcor.concordia.ca

Systems and Network analyst Concordia University
Instructional & Information Technology Montreal, Quebec, Canada
----------------------------------------------------------------------
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 05:39 PM
Mumia W.
 
Posts: n/a
Default Re: lpr-2005 and input filters

gobo20@lycos.com wrote:
> i posted the following on the debian_user group as that is where the
> lpr maintainer is, but it seems messages over there have to be
> approved. so, allow me to ask here as i'm using slack10.2
> [...]


You could've sent to the debian-user mail-list (debian-user [at]
lists.debian.org).

I can't see why your /etc/printcap isn't working. Sorry.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:14 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com