ITEM: I7887L

Data loss when printer taken off line.




Question:

Printing works fine except since printers are added as TTY's, if the
printer is taken off line between jobs, then all data sent to the
printer is lost.

FAXED Customer: howto_to_use_sticky_xon_for_tty

How to use sticky XON/XOFF with a tty

One of the major problems with adding a printer as a tty is that when
this is done, if the queue is empty and someone turns the printer
offline with only XON/XOFF flow control, all data sent to the printer
will be flushed out the port but not received by the printer.  This
happens because the driver ignores XOFF when the port is not open.
However, a tty can have multiple opens on the port.  We can take
advantage of this feature to solve the problem.  By creating a never
ending shell script, running the shell script with output redirected
to the port, we leave the port OPEN.  This will not effect the
operation of the

Created the following shell script:

\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\# while true
 do
 sleep 60000
 done \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#

called it holdtty

Ran as follows:

\# holdtty > /dev/tty4 &

As a caution to make ixon and ixoff not float run the following
command:

\# stty ixon ixoff \< /dev/tty4 &

I tested with a terminal by hitting CTRL-S , ofc light came on.  I
then sent data to the port with

\# lptest > /dev/tty4

No data was sent, the command hung until I hit CTRL-Q then data
started flowing.  CTRL-S stopped the data, CTRL-Q started again.  No
data was lost.

Next created a queue on the tty and sent data to the queue.

\#mkvirprt         1. Printer attached to host.
        Enter device name (or, ! to exit ) ->  tty4         select
printer type:

\# enq -Ptty5 /etc/motd

Once again I could stop flow with CTRL-S between or during jobs.

If I stopped the shell process running the sleep, then CTRL-S no
longer worked between jobs.



Support Line: Data loss when printer taken off line. ITEM: I7887L
Dated: May 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:44
Comments or suggestions? Contact us