> From [EMAIL PROTECTED] Thu Oct 17 12:22:47 2002
> To: [EMAIL PROTECTED]
> Subject: LPRng: lprng: Filters cannot write to file descriptor 3, which should be
> accounting file
> From: Camm Maguire <[EMAIL PROTECTED]>
> Date: 17 Oct 2002 13:59:38 -0400
>
> Package: lprng
> Version: 3.8.10-1
> Severity: normal
>
> Somewhere between (Debian) potato's 3.6.12-8 and woody's 3.8.10-1,
> shell script input filters can no longer write to file descriptor 3,
> which the documentation still states is attached to the accounting
> file if specified. This breaks lprfax, for example.
>
> Here is the input filter:
>
> #!/bin/bash
>
> . /usr/lib/lprfax/init
>
> Script_Init $@
>
> Erun $REMOVE fax-filter
>
> PAGES=$(ls -1 *.g3)
> NPAGES=$(echo $PAGES | wc -w)
> Erun $REMOVE [ $NPAGES -gt 0 ]
>
> Erun $REMOVE $JOIN $PAGES
> Erun $ABORT echo $JOB $NPAGES >&3
>
> exit 0
>
>
> Here is the printcap entry:
>
> .global:\
> :save_on_error:\
> :sd=/var/spool/lpd/%P:\
> :lf=:\
> :af=:\
> :pw=80:\
> :pl=66:\
> :px=1440:\
> :mx=0:\
> :mc#0:
>
>
> fax:\
> :server:\
> :tc=.global:\
> :lpd_bounce:\
> :[EMAIL PROTECTED]:\
> :af=acct:\
> :ab:\
> :pl=61:\
> :pr=/usr/bin/pr -l 61 -o 0 -h $-f:\
> :if=/usr/lib/lprfax/input-filter:\
> :be=/usr/lib/lprfax/fp-filter:\
> :hl:
Thanks! I will update the accounting information in the HOWTO and
other places. The problem that surfaced with the accounting file
attached to file descriptor 3 was that the LPD process AND the
filters would have it open. Some programs assumed that the connection
was to a remote server and then did a 'shutdown()' or something
similar on the file descriptor. This caused the connection to close.
Also, there were problems with people using 'printf()' and not flushing
the file output.
I finally gave up and threw in the towel. I thought I had removed all
of the descriptions about this.
#!/bin/bash
. /usr/lib/lprfax/init
Script_Init $@
# I assume this does something interesting like set some variables?
# note that '-c' does not take an option
while expr "$1" : '-.*' >/dev/null ; do
vAr=`expr "$1" : '-\(.\).*'`;
vAlue=`expr "$1" : '-.\(.*\)'`;
case "$vAr" in
- ) break;;
c ) c=1;;
[a-zA-Z] )
if test "X$vAlue" = "X" ; then shift; vAlue=$1; fi;
eval $vAr='$vAlue';
#setvar $vAr "$vAlue"
;;
esac;
shift;
done
Erun $REMOVE fax-filter
PAGES=$(ls -1 *.g3)
NPAGES=$(echo $PAGES | wc -w)
Erun $REMOVE [ $NPAGES -gt 0 ]
Erun $REMOVE $JOIN $PAGES
if [ -n "$a" ] ; then Erun $ABORT echo $JOB $NPAGES >"$a" ; fi
exit 0
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------