Enter stty -hupcl <&1 ; in the interface shell, Enter sleep 30 in the interface shell script im, For applications which must access the printer – Comtrol SCO OpenServer User Manual
Page 37: Unix spooler problems possible solutions

Troubleshooting
37
SCO OpenServer
UNIX Spooler Problems
The System V lp spooler has a known problem that causes serial ports
with buffers beyond the UNIX internal c-lists to drop characters at the
end of print jobs.
When the lp spooler daemon wants to print something, it forks a child
process. The child opens the printer port, then forks a process to run
the interface shell script. When the shell is finished printing, it exits.
There can still be characters in the output buffer at this point, but
because the child still has the printer port open, the shell exits
immediately. The child is notified that the shell has exited, it sends a
message to the daemon (via the named FIFO) indicating the print job
has completed, the child then exits, and the exit code eventually enters
the port’s close routine.
If there are still characters left to be output to the printer, the process
sleeps in the close routine until the characters have gone out the port
or until the process gets a signal.
The lp spooler, however, upon receipt of the “print done” message,
sends a sigterm signal to the child. If the child is in the close routine
waiting for characters, it wakes up, flushes its buffers, and exits. This
is how the data is lost.
Possible Solutions
1.
Enter stty -hupcl <&1 ; in the interface shell script immediately
before every possible exit. This prevents the shell from exiting
before all the characters have been sent out the serial port.
2.
Enter sleep 30 in the interface shell script immediately before
every possible exit. This also prevents the shell from exiting before
all the characters have been sent out the serial port.
3.
For applications which must access the printer device directly,
insert the following command in the /etc/rc.d/8/userdef file:
stty baud any_flow_control ; while: ; do sleep 3600; done)< portname &
Where baud is the printer baud rate, any_flow_control is any flow
control parameter such as ixon or ixoff, and portname is the serial
device name.
This line can also be issued as a command from the root prompt,
but unless nohup is used, the process exits and the serial line is
reset when root logs out. To ensure that the process is spawned
upon going into multi-user mode and continues until the system is
shut down or the process is killed manually, place this command in
/etc/rc.d/8/userdef.