[cups.general] shell script as filter -> core dump

Willi Burmeister wib at cs.uni-kiel.de
Tue Jun 17 01:55:57 PDT 2008


Hi,

I'm on my way to migrate our old LPRng installation to CUPS. The setup
was easy as all of our printers are network enabled postscript printers.

Now I'm trying to substitute 'texttops' with a filter of my own, as I
want all ASCII files send through 'mp'. For this I wrote a small 
shell script:

----------------------------------------------------------------------
#!/bin/sh

PRINTER=$0
JOB=$1
USER=$2
TITLE=$3
COPIES=$4
OPTIONS=$5
FILENAME=$6

/usr/local/bin/mp -text -landscape -a4 -alias "$USER" \
        -subject " $USER:$TITLE" $FILENAME

exit 0
----------------------------------------------------------------------

and changed the 'text/plain' line in 'mime.convs' to

----------------------------------------------------------------------
text/plain         application/postscript  33      mp_filter
----------------------------------------------------------------------

The script works without problems when called by itself, but does not 
work with cups. Even worse 'cupsd' stopped running after a SIGSEGV.

I searched the net for any information about writing filter for cups,
but could not found anything about shell scripts. Is there something
special to keep in mind? Does anybody have a working shell filter for
cups?

Any help is appreciated.

Thanks

Willi







More information about the cups mailing list