Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Problem OSR5. Interfaces not working ?

Status
Not open for further replies.

WavingDavid

Technical User
Oct 7, 2008
5
GB
Just come out to an ancient SCO box that's moved offices, and they've replaced their old Rico Aficio with a new one. Haven't touched this box in four years!
New printer sat on 192.169.6.99, port 9100. Using old setup (called nethp),
lp -d nethp testfile
prints test file with no CRLF so lines staggered. "Ah, simple, thinks I, just twiddle with the interface" Fat chance - any changes I make seem to be ignored. It's as if it is completely ignoring the interface script (though syslog complains if interface has no permissions, so spooling system is at least trying to touch it).
If i put
logger "starting interface" at start of /usr/spool/lp/admins/lp/interfaces/nethp, NOTHING is written to syslog.
What am I missing ?

David
 
If you are using the PORT-9100 I/F, the script you need to modify is in /usr/spool/lp/admins/lp/interfaces/model.orig.

We typically send out the leading code to enable CR/LF as a PCL-5 string. Something like this:
Code:
code="\0033&l1E\0033&k2G"

Then, later in the script, send out that code before you send the file:

while   [ "$copies" -gt 0 ]
do
        for file
        do
                echo -n "$code" 2>&1
                cat "$file" 2>&1          
        done
        copies=`expr $copies - 1`
done

(That's only a portion of the I/F script)
Are you sure you aren't using LPR/LPD on that printer?


"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Oooh -it gets even weirder!

If I print /tmp/test with
/usr/bin/lp -o nb -o land -o tl066 -o 12 -d david /tmp/test

it creates one file in /usr/spool/lp/temp, 303271-0.
The 271-0 file is the job control, with a line in it that says F /tmp/test (i.e. print the file /tmp/test)

If I print /tmp/test with
cat /tmp/test | /usr/bin/lp -o nb -o land -o tl066 -o 12 -d david

it creates *two* files in /usr/spool/lp/temp, 303271-0 control file as before, but with line
F /usr/spool/lp/temp/303271-1
and 303271-1 which contains the spooled data to print.

Why does is not create a file of data to be printed in the first instance - surely if the situation arises where printer temporarily disabled (say for maintenance) and the job submitted, and then someone deleted /tmp/test it would break?

Please assist if you can!
 
What is the content of /etc/printcap ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
nothing in /etc/printcap.
The printer I *was* trying to sort originally had this :
nethp:\ :lp=:rm=192.168.6.99:rp=ricoh:sd=/usr/spool/lpd/ricoh:eek:f=/usr/spool/lp/admins/lp/interfaces/nethp

 
And how did you define the david printer ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
The weirdness is :
lp -d david -o lots of options /prtest
Prints ok, does NOT create 123456-0 and 123456-1 in /usr/spool/lp/temp, just the 123456-0

cat /prtest | lp -d david -o lots of options
Does NOT print, creates 123456-0 and 123456-1

Really odd. As much info as I thought might be relevant follows:
(some redundant serial and parallel printer stuff snipped out for length)

Output of lpstat -t :
ricoh:
queuing is enabled
Printer status : Printing.(Ready.)
Online/Offline : Online.
nethp:
queuing is enabled
Printer status : Printing.(Ready.)
Online/Offline : Online.
newricoh:
queuing is enabled
Printer status : Printing.(Ready.)
Online/Offline : Online.
scheduler is running
no system default destination
device for ricoh: ricoh@192.168.6.99
device for nethp: nethp@192.168.6.99
ricoh accepting requests since 06:19:09 PM Wed 16 Jul 2
nethp accepting requests since 06:33:34 PM Wed 16 Jul 2
david accepting requests since 12:06:27 AM Fri 10 Oct 2
printer ricoh is idle. enabled since 03:55:13 PM Fri 03 Oct 2. available.
printer nethp is idle. enabled since 03:56:28 PM Fri 03 Oct 2. available.
printer david is idle. enabled since 08:42:53 PM Tue 14 Oct 2. available.

/etc/printcap looks like this:
# cat /etc/printcap
# Remote Line Printer (BSD format)
ricoh:\
:lp=:rm=192.168.6.99:rp=ricoh:sd=/usr/spool/lpd/ricoh:eek:f=/usr/spool/lp/admins/lp/interfaces/ricoh
nethp:\
:lp=:rm=192.168.6.99:rp=ricoh:sd=/usr/spool/lpd/ricoh:eek:f=/usr/spool/lp/admins/lp/interfaces/nethp
newricoh:\
:lp=:rm=newricoh:rp=newricoh:sd=/usr/spool/lpd/newricoh:
#


Now the weird thing is printer david is not on lpstat devices list, and is not in scoadmin printer. But it is printing!
And I know it WAS in scoadmin printer, because that's what I used to set it up. It's defined as printing to /dev/null,
with a model HPLAserjet (I think, though I did play around with the Net interface also from Linuts SCO stuff), and printing to /dev/null, and tweaked the interfaces script.

/usr/spool/lp/admins/lp/interfaces/david is as follows:
#!/bin/ksh

# /usr/spool/lp/model/NetCat - universal network printer interface script
# for OpenServer.
#
# Based on #
# Create a "Local Printer" in scoadmin
# Select "Net" as the printer model and /dev/null as the device.
# Create a corresponding line in /etc/printers, colon delimited:
# name:address:port:protocol:model:comments...
# name = name of the printer given in scoadmin
# address = ip address, hostname, netbios name of the print server
# port = tcp port number, lpr/lpd queue name, windows share name
# protocol = netcat or rlpr (others may be added)
# model = anything in /usr/spool/lp/model
# comments = MAC address & model of the printer & print server are helpful
#
# brian@aljex.com 20060723

LP=/usr/spool/lp
export PATH="${LP}/bin:/bin:/usr/bin:/usr/lib:/usr/local/bin:/usr/gnu/bin"
SELF=${0##*/}

while : ; do
IFS=: read NAME HOST PORT PROTOCOL MODEL COMMENTS || break
[[ "$NAME" = "$SELF" ]] && break
done < /etc/printers
INTERFACE=${LP}/model/$MODEL

[[ -z "$MODEL" ]] && exit 1
[[ -e $INTERFACE ]] || exit 1
whence $PROTOCOL >/dev/null 2>&1 || exit 1

case $PROTOCOL in
netcat) $INTERFACE "$@" | netcat -h $HOST -p $PORT ;;
rlpr) $INTERFACE "$@" | rlpr -H $HOST -P $PORT ;;
esac



/usr/spool/lp/model/HPLaserjet has this line added:
# Set up FILTER environment variable.
FILTER="/usr/lib/lponlcr"

and somehow during all this I have fixed stair-stepping.



David
 
printer david is not on lpstat devices list, and is not in scoadmin printer
Seems like you have a very old OSR5.
I'd apply the latest MaintenancePack.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Old ? OLD !?!?! This thing makes dinosaurs look like sprightly young johhny-come-lately's. It was authored some time before the Cambrian explosion, mate.

Ok, so please advise what maintenance pack, where to get, and how to see which I should have. Bear in mind, I installed this SCO system in about 1988, stopped being responsible for maintaining it in about 1995, and haven't touched SCO at all in over 5 years, so I'm *really* rusty.
Also would be useful if you mentioned how service packs are installed.

Regards
(and thanks for your help - much appreciated)
David
P.S. - will installing maintenance packs require kernel relink ? That scares me a lot. This box is very fragile, and there's no backup of the system - should I ghost it before updating ?
 
This box is very fragile, and there's no backup of the system
So, don't update it.
 
Some of your odd behavior might be covered by this article:


It sounds as if your printer(s?) have been configured and re-configured a couple of different times, and in different ways.

The differences you see with these commands is normal:

If I print /tmp/test with
/usr/bin/lp -o nb -o land -o tl066 -o 12 -d david /tmp/test

it creates one file in /usr/spool/lp/temp, 303271-0.
The 271-0 file is the job control, with a line in it that says F /tmp/test (i.e. print the file /tmp/test)

If I print /tmp/test with
cat /tmp/test | /usr/bin/lp -o nb -o land -o tl066 -o 12 -d david

it creates *two* files in /usr/spool/lp/temp, 303271-0 control file as before, but with line
F /usr/spool/lp/temp/303271-1
and 303271-1 which contains the spooled data to print.

The first instance tells the spooler to print that file. There is an option to create a temporary "copy" of that file first, which would prevent the situation you cite about the file being deleted before it is printed. The second instance doesn't give the spooler any file to print, so it HAS to create a temporary file of what you are feeding into it.

Your /etc/printcap is using the interface file as an Output Filter. I'm not sure how that works, but it seems odd to me. Perhaps that is just fine and dandy.

What revision are you running out there?
# uname -X




"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top