[cups.general] shell script as filter -> core dump
Helge Blischke
h.blischke at srz.de
Tue Jun 17 09:24:53 PDT 2008
Willi Burmeister wrote:
> 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
>
>
>
Look into mp's manpage for environment variables and set and export
the required ones in oyur shell script. It might be that mp
segfaults on null-pointers that stem from undefined environment
variables.
Helge
--
Helge Blischke
Softwareentwicklung
H.Blischke at acm.org
More information about the cups
mailing list