When I originally added the printer, it created the following files the
/usr/spool/lp/admins/lp/interfaces/corpitlbl
Code:
MODEL=`basename $0`
REALMODEL=`echo $0 | sed -e "s%$MODEL%model.orig/$MODEL%"`
#
# This name may be initialized when the script is
# installed in the spooler. If not, use the name
# of this script ($MODEL) as the peripheral to contact.
#
PERIPH=
if [ "$PERIPH" = "" ]
then
PERIPH=$MODEL
fi
LOG=/tmp/$PERIPH.$$
HPNPF=/usr/lib/hpnp/hpnpf
LPLOG=/tmp/hpnpf.$$
LOGTRIES=5
echo "$1\t$REALMODEL | $HPNPF -x $PERIPH" >> $LPLOG
#
# Remove the log file if job is cancelled
# or the scheduler is shutdown.
#
trap "rm -f $LOG $LPLOG; trap 15;kill -15 0;exit 0" 15
ERRORLOGS=0
while :
do
#
# Save the stderr messages in a temporary log file
# and discard stdout which is the peripheral output.
#
rm -f $LOG
if $REALMODEL "$@" | $HPNPF -x $PERIPH 2> $LOG > /dev/null
then
#
# If the transfer is successful, remove
# the log file and exit.
#
rm -f $LOG $LPLOG
exit 0
else
#
# Added the request ID to the stderr message
# and store it in the lp log file.
#
# Only record the first $LOGTRIES errors. If
# the spooler gets in a loop retrying a job, the
# disk won't fill up with spooler log error messages.
#
if test -s $LOG -a $ERRORLOGS -lt $LOGTRIES
then
echo "$1\t`cat $LOG`" >> $LPLOG
ERRORLOGS=`expr $ERRORLOGS + 1`
fi
if test $ERRORLOGS -eq $LOGTRIES
then
echo "$1\t$LOGTRIES errors logged for $1; errors no longer logged" >> $LPLOG
ERRORLOGS=`expr $ERRORLOGS + 1`
fi
fi
if [ ! -s $LPLOG ]
then
rm -f $LPLOG
fi
sleep 10
done
#ident "@(#)lp:model/dumb 1.3.1.2"
# lp interface for dumb line printer
#
x="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
#Set up some global variables.
: ${SPOOLDIR:=/usr/spool/lp}
: ${LOCALPATH:=${SPOOLDIR}/bin}
#Set up the default filter.
if [ -x "${LOCALPATH}/lp.cat" ]
then
LPCAT="${LOCALPATH}/lp.cat 0"
else
LPCAT="cat"
fi
#If we are not using a filter, use the default one.
if [ -z "${FILTER}" ]
then
FILTER="${LPCAT}"
fi
if [ -x "${LOCALPATH}/drain.output" ]
then
DRAIN="${LOCALPATH}/drain.output 1"
else
DRAIN=
fi
nobanner="no"
if [ -z "${BANNERS}" ]
then
nhead=1
else
nhead=${BANNERS}
fi
for i in $5
do
case "${i}" in
nobanner )
nobanner="yes"
;;
esac
done
if [ "no" = "${nobanner}" ]
then
while [ $nhead -gt 0 ]
do
echo "\014\c"
echo "$x\n$x\n$x\n$x\n"
banner "$2"
echo "\n"
user=`grep "^$2:" /etc/passwd | line | cut -d: -f5`
if [ -n "$user" ]
then
echo "User: $user\n"
else
echo "\n"
fi
echo "Request id: $1 Printer: `basename $0`\n"
date
echo "\n"
if [ -n "$3" ]
then
banner $3
fi
nhead=`expr $nhead - 1`
done
fi
copies=$4
echo "\014\c"
shift; shift; shift; shift; shift
files="$*"
i=1
while [ $i -le $copies ]
do
for file in $files
do
0<${file} eval ${FILTER} 2>&1
echo "\014\c"
done
i=`expr $i + 1`
done
if [ "no" = "${nobanner}" ]
then
echo "$x\n$x\n$x\n$x\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n$x\n$x\n$x\n$x"
echo "$x\n$x\n$x\n$x\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
echo "$x\n$x\n$x\n$x\n$x\n$x\n$x\n$x\n"
fi
#Draining characters might be necessary.
${DRAIN}
exit 0
So I'm not sure which file to add to and where in the file.
Hi everyone i have a question for all of you. It may be basic or it may be a good one. I recently aquired a copy of "SCO TCP/IP runtime System for SCO Unix" (thats what the disks say) and for the life of me i can not get it to load. i have tried opening the disk in linux and it can not determine... (0 Replies)
Hi,
I did shutdown and restart SCO server, now wanna find log to know exactly when system was effected. I took a look at /var/adm/ but seem there are no logs for my required information. it seems diff from Sun or HP UNIX...
appreciate all your help.
Thanks (2 Replies)
We're running SCO Open Server 5. On occassion we need to disable/enable HP print services. There's nothing that I have found in the HP printer manager that allows for this. I know we can stop/start print services via SCOADMIN. On occassion one of our HP printers will generate an error, the msg in... (4 Replies)
I would like to know if I can do a full system back
up on my Unix Sco openserver 5.0.5 Machine. If so, What
is the syntax to do this or where can I find this
information at?
Also, is it possible to make this tape bootable so
that I can easily do a full system restore? Any
information on... (2 Replies)
Hi! I'm about to throw away a shelf meter or so of SCO system V official documentation.
The original beige binders. I'm not sure if there is a shortage of these old books, but if anyone near Gothenburg, Sweden has use for them. Drop me a line at : martin (dot) rudolfson at mac (dot) com
Martin (4 Replies)
Hwey I manage a Unix box where I ama having multiple printer problems. the only way to get printers to print again is by rebooting. I stop and start services with no luck. Any one have any ideas? It can go weeks with being OK but then any given printer can go and cause the entire print queue to... (6 Replies)
Hi,
My SCO server freezes suddenly. I just want to know if there any tools / commands availble that can find which is causing the freeze?
Any help on this would be greatly appreciated.
Regards,
Ravikumar R (4 Replies)
Hi Guys,
Some time ago I get a disk for my SCO System V 3.2 R4.2 tcp 1.2.1 distribution. Now 4 Year later I am serarching the development system due to the fact that System V did not come with the C compiler. There is any change to get it ? my intention is academyc only.
or anyone... (3 Replies)