Global X2000 functions
started and the printer is activated. Printer malfunctions are detected if Xprint itself
detects a printer fault or if the number of queued print jobs exceeds a user-defined
value.
If a fault is present or is likely due to the excessive queue length then the RESERVE-CCW
is acknowledged with an equipment check error. This results in a spool error message
at the BS2 console.
Communication between script and printer emulation is performed via a file
(/var/opt/SMAW/X2000/tmp/spool_busy.<mn>) which is first deleted by the
emulation and then regenerated by the script if a fault is present. If this file is present
after execution of the script then the emulation recognizes that an Xprint error situation
exists.
Example script /opt/SMAW/X2000/bin/spoolstate.L0
The UNIX printer 4826seh is assigned to the BS2 printer L0:
U41272-J-Z385-3-76
# Determine number of print jobs in queue
SPOOLQL='xpstat | grep 4826seh | grep WAIT | wc -l' ;
# Check printer for error state
SPOOLQE='xpstat | grep 4826seh | grep 'D (' | wc -l' ;
# Check whether Xprint and printer are active
SPOOLNA='xpstat -dev 4826seh | grep ON | grep ACTIVE | grep -v NOT' ;
if [ \( $SPOOLQL -gt 5 \) -o \( $SPOOLQE -ge 1 \) ]
then echo SPOOL IS NOT READY > /var/opt/SMAW/X2000/tmp/spool_busy.L0
echo $SPOOLQE job device busy/printer fault
/var/opt/SMAW/X2000/tmp/spool_busy.L0
echo $SPOOLQL jobs waiting >> /var/opt/SMAW/X2000/tmp/spool_busy.L0
elif [ "$SPOOLNA" = "" ]
then echo SPOOL not running or printer not active >
/var/opt/SMAW/X2000/tmp/spool_busy.L0
else exit 0
fi
Configuring printers
>>
263