> From [EMAIL PROTECTED] Wed Mar 20 03:42:31 2002
> Subject: LPRng: Problem with OF filter on latest ifhp
> To: [EMAIL PROTECTED]
> Date: Wed, 20 Mar 2002 10:42:33 +0000 (GMT)
> From: Jonathan Knight <[EMAIL PROTECTED]>
>
>
>
> I've got the latest ifhp but seem to have a problem when it is used as an
> "of" filter. We have bean counters so I need accounting and banner pages.
> The printcap appears as:
>
> 'common
^^ use . (period) PLEASE!!!
> :rw
> :mx#0
> :sb
> :sd=/var/spool/lpd/%P
> :lf=log
> :ps=status
> :fx=flpv
>
> cspr2|Computer Science Student Laser Printer
> :sv=cspr2.a
> :tc='common
>
> cspr2.a
> :ss=cspr2
> :lp=XXXXXXXXXXXX.cs.keele.ac.uk%9100
> :filter=/usr/local/LPRng/libexec/filters/ifhp
> :of=/usr/local/LPRng/libexec/filters/ifhp
> :bp=/usr/local/LPRng/libexec/filters/psbanner
> :achk
> :as=/usr/local/LPRng/libexec/filters/accfilter XXXXXXXX
> :ifhp=model=hp4050,accounting=/usr/local/LPRng/libexec/filters/accfilter
>XXXXXXXXXX
> :tc='common
>
>
> At this point I would love to attach some logging output but the log files
> rotated before I got to them. I shall send a copy as soon as it happens
> again.
Set 'max_log_file_size=10000' or 10 meg.
This should be big enough...
>
> What seems to go wrong is that the students switch the printer off then on
> during a job. The obvious fix is some user education but we're dealing
> with undergraduate students and that is not an option. What seems to happen
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:-)
> is thst ifhp correctly discovers that the printer has gone away and
> instigates a JFAIL for the job. So far so good, but as soon as ifhp
> disapears LPRng restarts the "of" filter which then sits forever waiting to
> do the accounting which is never going to happen. Eventually the 6000
> second timeout for the send job triggers and LPRng resets the queue.
OK... This appears to be something more subtle. When the ifhp filter
gets an error, it will exit. The TCP/IP connection should still
be open.
At this point the OF filter is woken up, and sends a 'query' to the printer.
However, it should get an 'error' at this point, and should exit with
an error message. I am puzzled why it does not.
----------- Long pause while various experiments are tried...
----------- OK, problem reproduced... sort of
The real problem seems to be that when the ifhp filter (either running as the
job filter or the of filter) has sent the 'return status when done' command
to the printer, it sits and waits for a return status from the printer.
Unfortunately, it will not get it as the printer will not spontaneously
return status information. The TCP/IP 'keepalive' facility will cause
a 'empty' TCP/IP packet to be sent to the printer. By default, the lpd
server sets 'keepalive' on all socket connections. However, this may not
be implemented, or may be the default timeout value is the
useless 2 hours (see Unix Network Programming, Second Edition, W. Richard Stevens,
Volume 1).
You can try to lower this value to something like 1 minute using the sysctl
facility or whatever you have on your system. BEWARE! This may have subtle
interactions with other network connections. I blew a couple of high load TCP/IP
systems away doing this.
The problem is that you cannot PROVOKE a response from the printer
when it comes back up without sending something to it.
I have implemented a 'software time to live' option that is controlled
by the ifhp 'waitend_interval' value.
You might want to try:
pr:
:ifhp=waitend_interval=60,model=...
This will send a probe to the printer every minute. While it is NOT the best
way to handle this, it WILL detect the fact that the printer has gone
away after 1 minute. The bad news is that if the printer is off line,
then this might result in a 'bad job' report and the job being abandoned
(ifhp exits with error status).
>
> I'm not sure what I want to happen here. Some ideas are:
>
> 1. If the "if" gets a JFAIL then the "of" is killed as well.
> 2. The "of" should timeout after 20 seconds of trying to get a response.
> 3. on JFAIL the job should be restarted rather than removed
> (I can see the option for this in the printcap but what happens
> after 3 attempts?)
>
> Thoughts? Options?
>
> --
> ______ [EMAIL PROTECTED] Jonathan Knight,
> / Department of Computer Science
> / _ __ Telephone: +44 1782 583437 University of Keele, Keele,
> (_/ (_) / / Fax : +44 1782 713082 Staffordshire. ST5 5BG. U.K.
>
> -----------------------------------------------------------------------------
> 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.
> -----------------------------------------------------------------------------
>
-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------