Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!seismo!mcvax!enea!coke!robert From: robert@coke.UUCP Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Filters for the BSD print spooling system Message-ID: <111@coke.UUCP> Date: Mon, 30-Mar-87 08:58:12 EST Article-I.D.: coke.111 Posted: Mon Mar 30 08:58:12 1987 Date-Received: Wed, 1-Apr-87 01:26:18 EST Organization: Statskonsult Programvaruhuset AB, Sweden Lines: 43 Keywords: sun bsd print spooler printer filter Xref: utgpu comp.unix.questions:1553 comp.unix.wizards:1593 I'm not really sure whether this should go to comp.unix.questions or comp.unix.wizards, so I send it to both. I'm trying to write some filters for the different kinds of printers we have here. The filters will be forked off by Sun's/Berkeley's lpd printer daemon. So, what's the problem, you might ask. Those filters should only take the standard input, process it, and send the result to the standard output. Well, that's what I thought. The first of my filters, epsonf, worked just fine when run from the command-line using redirection and/or pipes, but when I installed it as if (input(?) filter) and of (output filter), only the banner page got printed and then the filter hung. Seems like lpd expects the output filter (the one which prints the banner page) to release its standard output file, or something, before lpd can let the input filter do the actual printing. Then I tried to remove the input filter specification from /etc/printcap and let all output go through the output filter. That seemed to work. Hmmm, strange, I thought. Just to be sure the problem was in my filter and nowhere else, I used the standard /usr/lib/lpf filter as both input- and output filter, which, of course, worked like a dream (the dream I had about how my filter should work, that is, without any problems). Using /usr/lib/lpf as the output filter and my filter as the output filter worked equally well. So, here comes my question: How Do I Write a Printer Filter for the Berkeley Printer Spooling System? What signal's should I trap (the only signal that's documented is SIGINT that is sent when I use lprm to remove a job), and what should I do when I have got that signal? Anything else to think about, too? Thanks, Robert. _______________________________________________________________________________ NAME: Robert Claeson PHONE: +46 8-730 03 00 PAPER: Statskonsult Programvaruhuset AB P.O. Box 4040 "Whatever it is, it's not S-171 04 Solna my problem." Sweden UUCP: {seismo!}mcvax!enea!coke!robert _______________________________________________________________________________