Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!rochester!ken From: ken@rochester.UUCP Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Filters for the BSD print spooling system Message-ID: <26513@rochester.ARPA> Date: Mon, 30-Mar-87 16:30:57 EST Article-I.D.: rocheste.26513 Posted: Mon Mar 30 16:30:57 1987 Date-Received: Wed, 1-Apr-87 01:41:58 EST References: <111@coke.UUCP> Reply-To: ken@rochester.UUCP (Ken Yap) Organization: U of Rochester, CS Dept, Rochester, NY Lines: 36 Keywords: sun bsd print spooler printer filter Xref: utgpu comp.unix.questions:1555 comp.unix.wizards:1601 I don't know what your specific problem is but here are some things I discovered while writing lpd filters myself. Pay attention to the environment of the filter when it is run. One way of debugging is to do "su - daemon" to get the enviroment of the daemon. You will find that only a few directories are on the path. I personally use absolute pathnames for any commands run in the filter. I prefer to use sh for filters (and shell programming in general). Faster and less hassles. I put this line near the top of the filter script: trap "rm -f TEMPFILES" 0 1 2 3 15 Check that the permissions of any files (e.g. logfiles) that need to be written on are correct for group daemon. Another thing I discovered only by looking through the lpr code is that the -d, -n and -t flags imply -l, and the last flag specified supercedes the previous ones, so don't type "lpr -d -l foo.dvi" because the job will be queued with the l flag (print raw). Here is an example of our dvi to press filter running here: #! /bin/sh statusfile=/usr/spool/raven/status trap "/bin/rm -f /tmp/$$.dvi /tmp/$$.press" 0 1 2 3 15 umask 077 /bin/cat > /tmp/$$.dvi /bin/echo "Converting dvi to Press" > $statusfile 2>&1 /usr/staff/bin/dvip -p /tmp/$$.press /tmp/$$.dvi > /dev/null /bin/echo "Sending Press file to Raven" > $statusfile /usr/lib/xpressf < /tmp/$$.press exit 0 Ken