TCPrint for AIX - Verizon.net

existencetubNetworking and Communications

Oct 26, 2013 (3 years and 9 months ago)

91 views











TCPRINT






for AIX

























LAIX Software Consulting

(
800) 558
-

LAIX

PO Box 1001 Derby, KS 67037
-
1001

laixsoft@laixsoft.com

http://www.
laixsoft.com




October
28, 2006


2

LAIX Software Consulting

(800) 558
-
LAIX

laixsoft@laixsoft.com


More current information may be available in /usr/lpp/TCPrint/TCPrint.readme file !!!


Table of contents:


I

TCPrint Product Description

II

Will TCPrint work for me?

Table of tested network servers

III

Installing TCPrint

IV

Configuring TCPrint

V

Using TCPrint
-

diagnosing any trouble

VI

Detailed technical information and Customization
.

VII

Troubleshooting

VIII

30
-
day evaluation copy

I
X

Pricing and support information



I

TCPrint Product Description


TCPrint is a utility for IBM's AIX operating system versions 3.2.x, 4.1.x,
4
.2.x
, 4.3.x, 5.1.x, 5.2.x,
and 5.3.x
. It is a

utility which fits

transparently into

the AIX virtual printer and print spooling
subsystem allowing

users to print from an IBM RS/6000 or PowerPC running AIX to nearly any
TCP/IP print server

device. The product has been tested to print to IBM and non
-
IBM X
-
stations,
HP JetDirect and JetDire
ct EX3 print servers, Xyplex, Annex, and Xylogics terminal servers, and
Cisco 2511 routers with serial or parallel ports on them. It should be able to print to any network
printer/terminal
s
erver which supports TCP/IP. It is ideal as a replacement for AI
X remote print
queues because it eliminates the common problems or queues going down during or between jobs.



II

Will TCPrint work for me?



TCPrint operates by establishing a TCP connection to a user
-
specified TCP port number on the


print server's IP ad
dress. Suppose that your XYZ print server manual instructs you that all


data sent to the server on TCP port 2001 will be printed to serial port 1 on the server. To find out


if TCPrint will work for your needs before ever installing the software, try a

few simple tests. Be


sure that you can ping the server's IP address to ensure proper network connectivity. Then, try


to telnet to the TCP port number your print server listens to for incoming print data. For


example:




telnet <ServerIP> 2001



If

you are connected then you know the server is listening for incoming jobs on that port. If you


are unable to connect to the server this way then TCPrint will not be able to either. If you do get


connected anything that you type should print on the pri
nter. Assuming that this step succeeds,


try sending a print job to the server on the specified port (2001) as follows:




lptest | telnet <ServerIP> 2001



This will send the output of the lptest command (about 3 1/2 pages) to the server on TCP port


num
ber 2001. The job should print but then you should remain connected in the telnet session


afterwards. If this is successful, then TCPrint will be able to print to the server as well.


3




Table of network servers used with TCPrint




Server


TC
P port number(s)


Comments

3COM

Configurable port number

Customer reports excellent result

Annex Terminal Servers

7000 + port number (7001
-
7016)

Customer reports excellent result

Axis NPS 540/640

Configurable port number

Customer reports excellent result

Castelle LanPress MP

3000, 3010, 3020

Requires
adjusting

s flag in
TCPrint.sh

Chase IOLAN

10000 +port (10000
-
100016)

Customer reports excellent result

Cisco

2511 router/terminal server

4000 + port number (4001
-
4016)

Excellent results

CompuTone IntelliServer

9000 + port number (9000
-
9063)

Customer reports excellent result

DataProducts Typhoon

Configurable port number

Customer reports excellent result

DigiB
oard FastPort

Unknown

Customer reports excellent result

DigiBoard PortServer

2100 + port number (2101
-
2116)

Customer reports excellent result

DEC 770 terminal server

Configurable port number

R
equires delay
-

good results

DPI Netprint Server

10001 (single port server)

Excellent results.

DPI Netprint Server (3
-
port)

10000 + port num (10001
-
10003)

Requires
adjusting

s flag in
TCPrint.sh

Emulex

2051 = parallel, 205
2 = serial

Customer reports excellent result

Equinox

3501

Customer reports excellent result

ExtendNet (4
-
port)

9100, 9101, 9102, 9103

Customer reports excellent result

FaxStar

9100

Excellent results

HP DTC Terminal Server

9239

Unknown

HP JetDirect int
ernal and EX

9100

Excellent results

HP JetDirect EX+3

9100, 9101, 9102

Excellent results

Hughes Terminal Server (8
-
port)

7501


7508

Customer reports excellent result

IBM 7318 model S20 server

Configurable port number

Excel
lent
-

forget CNS connect!

IBM Network Station

serial=87, paralell=5964

Unknown

IBM X
-
station 120, 130

8000 for X
-
station parallel port

Excellent results

Intel Netport

9100

Customer reports excellent result

Intel Netport PRO

3001, 3002

Customer reports

excellent result

Intel Netport XL

parallel=3001,3002 serial=2501

Customer reports excellent result

Lantronix (EPS1 and others)

3000 + port number (3001
-
3016)

Customer reports excellent result

Lexmark Optra

9100

Excellent results

Micom

Unknown

Customer

reports excellent result

Milan

MIL
-
3100:


Serial #1 2001


Parallel #1 2010


MIL
-
3200:


Serial #1 2020


Serial #2 2021


Parallel #1 2010


Parallel #2 2011



MIL
-
3400:


Parallel 2010






Customer reports excellent result

Synoptics

2000 + (100 * port_number )

Unknown

XCD Xconnect

parallel=9100 serial=9101

Customer reports excellent result

XCD Xconnect II

Configurable (1024
-

)

Customer reports excellent result

Xyplex

2000 + (100 * port_number)

Excellent results



4

TCPrint should w
ork with numerous other TCP/IP printer and terminal servers. We appreciate any

feedback on successful or unsuccessful makes and models to include in reference material.

III

Installing TCPrint




TCPrint for AIX consists of several files which are archived

together in a tar file. You may

receive this tar file via floppy diskette or via modem or ftp. If you receive the software on floppy,

ou can extract the tar file from the diskette as follows:



tar
-
xvf /dev/fd0



If you receive the file via another m
eans such as via modem or ftp, you will need to extract the


files from the archive in a similar manner:



tar
-
xvf /your/filename



Several files will be extracted from the tar archive:




/usr/lpp/TCPrint/bin/TCPrint


-

The utility that actually does the

sending









of data across your network. This file is









not user modifiable.




/usr/lpp/TCPrint/bin/TCPrint.sh


-

The "backend" called by the AIX queuing









system when it has a print job to send to a









network printer. This is

a shell script that









is user
-
modifiable to customize and tailor









TCPrint functions.




/usr/lib/lpd/pio/etc/TCPrint.config


-

The file which gives AIX 3.2 SMIT









screens to setup TCPrint virtual printer









queues. This file
is user
-
modifiable to









customize smit mkvirprt screen

options.




/usr/lib/lpd/pio/etc/TCPrint.attach


-

The file which gives AIX 4.x SMIT









screen entry points that allow AIX 4.x









users to add print queues through SMIT.




/usr/l
pp/TCPrint/bin/piomkTCPrint


-

Called by SMIT to add/remove print









queues in AIX 4.x




/usr/lpp/TCPrint/bin/TCPrint_setup_AIX4

-

This script MUST be executed ONCE









after installation on AIX 4.x systems









to add in AIX 4.x SMIT scr
eens.




/usr/lpp/TCPrint/bin/TCPrint_setup_AIX5
-

Symbolic link to AIX4 setup script









No difference between AIX4 and AIX5









Setup.




/jusr/lpp/TCPrint/bin/porttester


-

Used to probe a print server to see which









TCP ports it ac
cepts connections on.




/usr/lpp/TCPrint/bin/TCPrint.uninstall

-

Removes software from your system.









Does NOT removed
print
queues





There may be an optional file if any changes to the program have been made since



the documentation was written
:



5



/usr/lpp/TCPrint/TCPrint.readme


-

Any additions or modifications to the









documentation or operation of TCPrint.

IV

Configuring TCPrint



Once the software has been successfully extracted from the tar file, what comes next


depends on your lev
el of AIX.



AIX 3.2.x:



You may begin adding print queues immediately, either through the SMIT fastpath


“smit mkvirprt” or from the command line “mkvirprt”.



Select the option number corresponding to "Network printer (Arbitrary TCP port)" to invoke


th
e TCPrint configuration utility. You will then be guided through a series of selections needed


to setup the print queue:



1) Enter the printer hostname



This is the hostname you have assigned to the printer or print server's IP address in



your /etc/h
osts file or on your network's nameserver. You can directly placed the dotted



decimal IP address here, but it is not recommended. If you ever change the printer's



IP address you would then also need to change the print queue information.



2) Enter t
he printer's TCP port number or service name from /etc/services



This is the TCP port number that the print server listens to for incoming print job



requests (see section II). This generally tells the print server device where to direct



your job requ
est to. If you will be repeatedly using the same port numbers for many



queues, consider adding a name to the port number in the /etc/services file.




3) Insert a one second delay after every ? packets of the print job (0 for no delay)?



The only termi
nal server encountered so far that requires this option is the DEC



terminal server. Use this option to slow the speed at which data is sent to the



print server.



4) Make this system the bootp/tftp server?




bootp/tftp is a means by which the printer

or print server broadcasts a request at



power on for another host machine to assign it an IP address, default gateway, and



subnet mask.




Most print server devices do not use bootp/tftp and it does not generally work across



routers or FDDI networ
ks since routers are commonly configured not to let these



requests across to other networks since they are a major source of network traffic. If



you do select to make AIX be the bootp server, you will need to enter the printer's



MAC address (etherne
t or token ring hardware address), and optionally the subnet



mask and default gateway you wish to assign the printer or print server. If you are



using bootp be sure that the bootps line is uncommented in your /etc/inetd.conf file



and run inetimp;ref
resh
-
s inetd if you make changes to the inetd.conf file.



5)

Enter the file to send debugging output (/dev/null)




TCPrint sends a great deal of diagnostic and troubleshooting information to standard



output. If TCPrint is functioning properly, you ma
y wish to send this output to /dev/null



effectively discarding this information. If you are setting up TCPrint for the first time,


6



or are experiencing problems with TCPrint, you may wish to log this information to a



file such as /tmp/TCPrint.log to

assist in diagnosing the cause of the problem.


Next you will select your printer type, and the queue name(s) for the data stream(s) the printer


can support.



If after adding the queue and exitting from smit or the mkvirprt command and performing an


lpstat to check the queue status you notice that the queue's status is UNKNOWN, you can


easily resolve the problem by doing a stopsrc
-
cs qdaemon; startsrc
-
s qdaemon. This will


not affect other print jobs on the system and is not a problem with TCPrint

but a limitation of


the AIX qdaemon.




At this point TCPrint has touched a few files you may wish to examine:



/etc/qconfig:




Two stanzas have been added to the file:



1) A queue stanza and



2) A queue device stanza




The entries may look somethin
g like this:




myqname:




device = myserver



myserver:




file = FALSE




backend = /usr/lpp/TCPrint/bin/TCPrint.sh <server> <TCPport> <delay> <logfile>




If you need to manually edit this file be sure to run enq
-
d after any changes you make.



/
etc/bootptab




If you are using bootp/tftp to assign the printer an IP address an entry will have been



added that bootpd uses to boot your printer. The entry will have the IP address,



hardware address, and optionally a subnet mask and default gatewa
y that you gave.



/var/spool/lpd/pio/custom/myqname.myprintserver




This file is the virtual printer custom file commonly called a colon file. It contains all of



the formatting options for your job such as the pitch, fonts, orientation, etc. of your



job.




Remember
-

TCPrint will not do anything to format your data. The AIX virtual printer



formats your print job completely and then passes it to TCPrint which sends the job as
-
is



to the print server. This ensures that a TCPrint queue will be
have identically to the



formatting options of any virtual printer defined on the system.








7




AIX 4.1.x and
above
:




Before configuring TCPrint on an AIX 4.X system, you must have the fileset printers.rte


(run time environment) installed on your sy
stem. You can check whether or not the fileset


is installed using the command lslpp
-
h printers.rte



If you get the message that this fileset is not installed, install it from your AIX installation


tape or CD before continuing with the TCPrint configur
ation.



There are two methods by which queues can be created for AIX 4.x

and 5.x
. If you do NOT

wish to

use or install the SMIT screens for TCPrint you can add queues with the three step process


below:



METHOD 1

(not recommended)
:



1) Create a
"fake device file” in the /dev directory (lpa in the example below)



Be sure the name is unique for each queue you create. It's



best NOT to use a name that AIX could ever use (like lp0).




> /dev/lpa



2) Create a print queue that prints to the fa
ke device:



smit mkpq



Print to a file (in /dev directory)



Create queue(s) for your data stream(s) that print to /dev/lpa



3) chquedev
-
q QNAME
-
d DNAME
-
a "file = FALSE"
-
a
\



"backend = /usr/lpp/TCPrint/bin/TCPrint.sh SERVER TCPPORT

DELAY LOGFILE"




where FALSE is the actual word FALSE



QNAME is the queue name you added via SMIT



DNAME is the device name you created (lpa in my example)




SERVER is the hostname or IP address of the print server



TCPPORT is the TCP/IP port nu
mber or service name that the




server listens on for incoming print jobs.



DELAY is the number of packets of data you want to print before




pausing one second. Use 0 for no pause. Previous




experience has shown DEC terminal servers require




th
is delay.



LOGFILE is the file where you want logging and diagnostic




info sent to. If /dev/null is specified, all of the




logging and diagnostic info is discarded.



In the event you wish to use bootp/tftp to assign the print server device its IP ad
dress


without installing SMIT screens, AIX 4.x users need to manually add an entry to the


/etc/bootptab file.





If your print queue shows a status of UNKNOWN after the above steps, it will be


necessary to stop and restart the qdaemon:




stopsrc
-
cs
qdaemon; startsrc
-
s qdaemon


8



METHOD 2 (preferred):



If you are using AIX 4.x
or 5.x
and want to have SMIT screens added to create print queues


instead of using METHOD 1 from the previous section, the SMIT screens must first be


added into AIX’s ODM (
Object Database Manager). This is accomplished by running the


TCPrint setup utility:

/usr/lpp/TCPrint/bin/TCPrint_setup_AIX4



or



/usr/lpp/TCPrint/bin/TCPrint_setup_AIX5



This setup utility will perform the following actions:




1) Remove TCPrint fi
les which are necessary only for AIX 3.x (if you give permission



to do so)



2) Make a copy of your current SMIT screen files into the directory



/usr/lib/objrepos/smit_screens_backup



3) Add the SMIT screens from the file /usr/lpp/TCPrint/TCPrin
t.add into your SMIT



screens database.







After the script completes, TCPrint queues can be added, changed, and removed through


SMIT, or you can get directly to the SMIT screens through the SMIT fastpaths:



smit mkpq

-

Make

print queue


smit ch
pq

-

Change

print queue


smit rmpq

-

Remove print queue



An example of adding a print queue for AIX 4.x through SMIT follows:



1) Start smit and select to add a print queue. You may use the smit fastpath from the



command line to get directly to the

desired smit screen “smit mkpq”



2) Select TCPrint option from the list of attachment types.



3) Select the printer manufacturer and printer model. If your particular printer does



not appear on the list, select the closest match available.



4) S
elect whether or not you want AIX to be a bootp/tftp server for the print server



device where the printer is attached. Using bootp allows AIX to assign the IP address



to the print server when it is powered on. If the print server already has an

IP address,



the print server and the AIX host are on seperate network (seperated by a router), or



there is a FDDI link between the AIX host and the print server, bootp should not be



used to assign the server an IP address.



5) You will b
e presented with a SMIT screen that requires you to enter in options for the



TCPrint connection to the print server.








9




If you are NOT using bootp to assign the server an IP address, the screen will look


like this:




*HOSTNAME of the print s
erver


[]



*TCP port number



[]




Insert 1 second delay after every ? packets

[0]




File to send diagnostic output to


[/dev/null]



If you are using bootp/tftp to assign the server an IP address, 4 additional options will


be displayed:





*HARDWA
RE ADDRESS of print server

[]



*Ethernet or Token Ring



[]




Gateway address



[]




SUBNET MASK



[]



Options with an * are required fields. Other fields are optional.




HOSTNAME of the print server

This should be hostname that resolves to the IP






address of the print server. The IP address should






not be used directly.



TCP port number



The TCP port number that your print server listens on






for incoming print jobs (See table in section II)



Insert 1 second delay after


This is usef
ul to slow down the rate AIX sends jobs to


every ? packets



the print server. It can help reduce flow control problems






between a print server and printer as well as prevent a






network print job from using the entire bandwidth of a






slow n
etwork link such as SLIP, PPP, or a low speed






leased line. The default if no value is given is “0”






meaning no delay is added
.

Try a value of 3 to 5 to start



tuning

this at
tribute. Lower number (1 or 2) cause more



dramatic reductions in transmission speed than higher



values.




File to

send diagnostic output to

TCPrint can generate a great deal of diagnostic output






for troubleshooting network printing problems. If no






value is specified, the default is /dev/null
-

discarding






the logging output. If a filename is given, a
cumulative






log is generated. Be careful that this file does not grow






too large and fill the filesystem where the log resides.






(See section VI on overwriting the log file instead of






appending to it for each print job to prevent the log






from growing.)



If your queus are in a status of “UNKNOWN” after adding the queue, you may need to




stopsrc
-
cs qdaemon; startsrc
-
s qdaemon




This isn’t a problem with TCPrint but a limitation of the AIX print queue system.


10




Additional options
are required for bootp/tftp. These options are only needed if you


want to use AIX to assign the print server its IP address.




HARDWARE ADDRESS of

If you are using bootp to assign the printer an IP address


the print server



the print server will send
out a request when powered on






that contains its MAC (ethernet or token ring hardware)






address. If AIX is acting as a bootp server for this hardware






address, it will reply to the request.




Ethernet or Token Ring


The physical network type
is needed to properly build the






entry in /etc/bootptab for bootp/tftp




Gateway address



The default gateway that is to be assigned to the printer.






If hosts on another network (beyond a router) need to






print to this print server, the print

server needs to know






the gateway to use to get packets back to the host. The






gateway address should be the IP address of the network






interface on the router which is connected to the print






server’s network, NOT the client hosts. If n
o gateway is






supplied, then no hosts beyond the local network segment






of the print server will be able to print.




SUBNET MASK



The subnet mask is used by TCP/IP to determine whether






or not an IP address is or is not on the same network






segment. Subnet masks on the print server which do not






match that of the rest of the hosts on your network may






result in some clients being unable to print.




Be sure that the “bootps” line isn’t commented out in /etc/inetd.conf or AIX’s
bootpd


daemon won’t be active. If you are experiencing problems with bootp, you may wish to


start bootpd in debug mode to see why bootp is failing. First, comment out the bootps line in

/etc/inetd.conf by placing a “#” at the beginning of the line. T
hen kill any “bootpd” processes

which are running on the system. Next, refresh
-
s inetd to make the changes to the inetd.conf


file take affect. You can now start bootpd in debug mode from the prompt: bootpd
-
d
-
d
-
d
-
d
-
s


The most common problems wit
h bootpd are syntax errors in the entry in /etc/bootptab. Other


common problems include trying to use bootp to boot a print server across a router, or across


a FDDI network connection.




If after adding or removing any print queue on the system the lps
tat command shows your


queues as UNKNOWN or your queues are READY but no jobs are printing, qdaemon


needs to be restarted:





stopsrc
-
cs qdaemon; startsrc
-
s qdaemon



This will not affect other print jobs or queues on your system, and is not a proble
m with


TCPrint but a limitation of the AIX qdaemon.




11


V Using TCPrint



Now that TCPrint is configured you can print to the print queue just as you would to any other


print queue on the system. Several examples follow to show various ways to print t
o the queue:



lp
-
d myqueuename /some/file/name


cat /etc/qconfig | lp
-
d myqueuename



enq
-
Pmyqueuename /some/file/name


lptest | qprt
-
Pmyqueuename



Once TCPrint has been installed behind the scenes, it is transparent to the user. TCPrint does

NOT

format the data of any print job. Instead, it passes all jobs through an AIX virtual


printer. If your jobs are printing but are formatted improperly (such as line wraps, the


wrong pitch or font, etc.) then the attributes of the AIX virtual printer nee
d to be checked.


If you are printing from an application that formats the print data and do not want the AIX


virtual printer to do any formatting of the job, put the AIX virtual printer into a pass
-
thru


mode as follows:




lsvirprt




Select your pri
nt queue




_d=p



Setting the _d (data
-
type) to p (pass
-
thru) inhibits AIX from formatting your jobs.



If you are experiencing any problems with connectivity (nothing printing or queues going


DOWN) then the logging information that TCPrint generates is
a great way of finding out


what went wrong. If you want to turn TCPrint diagnostic logging off or on you can


vi /etc/qconfig and alter the stanza for your print queue. Find the backend = line for the


queue device stanza which will look something li
ke:




backend = /usr/lpp/TCPrint/bin/TCPrint.sh <server> <port> <delay> <logfile_name>




Use /dev/null as the logfile_name to discard logging output. Any other filename will


cause logging to be appended to that file. If you leave logging on, be sure t
o watch the file


size so as not to fill the filesystem.



If you need more detailed information about problems printing with TCPrint running an


iptrace is an excellent way to determine what is flowing across the network:



iptrace
-
a
-
b
-
p <TCPport>
-
s
<AIX_IP>
-
d <PrintServerIP> /tmp/iptrace


Send a print job


ps
-
ef |grep iptrace


kill <iptrace_process_id>


ipreport /tmp/iptrace > /tmp/ipreport



The ipreport will show all network packets between the two hosts on the specified TCP port.


If the trace
is empty, either no packets are being sent
-

or one of the hosts has more than one


network interface and the IP address of the wrong interface may have been specified.





12


VI

Detailed technical information and customization



Much of the work of TCPrint

is performed by the backend shell script


/usr/lpp/TCPrint/bin/TCPrint.sh. When a print job is queued to a TCPprint print queue


the AIX qdaemon invokes the backend shell script passing it command line arguments


that you specified when you created your
print queue.



For example, suppose you created a print queue named netq that prints to your network


print server with hostname netserver. Your netserver host prints jobs that come to it on


TCP port number 4005 to the printer attached to port 5 of the s
erver. Furthermore, you


have configured TCPrint not to force any slowdown or delays to this server, and you are


logging diagnostic output into the /tmp/log file until you are certain all is working


properly. Your entry for this queue in /etc/qconfig m
ay look something like this:



netq:



device = netserver


netserver:



file = FALSE



backend = /usr/lpp/TCPrint/bin/TCPrint.sh netserver 4005 0 /tmp/log




You then decide to queue up a job, and you want this job to print in landscape mode, with


132

characters per line:



qprt
-
Pnetq
-
z+
-
w132 /my/file



The AIX qdaemon will then examine the job request and the entry in the qconfig file, and


invoke the command:



/usr/lpp/TCPrint/bin/TCPrint.sh netserver 4005 0 /tmp/log
-
z+
-
w132 /my/file



The TC
Print.sh shell script is started. The script is as follows:



#!/bin/ksh


HOST= $1


# The server’s hostname is the first command line option


PORT=$2


# The TCP port number on the server the job goes to


DELAY=$3


# If DELAY > 0, force the slowdown of se
nding data to server


DEBUGFILE
=$4


# File to send detailed logging to
-

use /dev/null for no logging


shift 4



# Now discard these first 4 command line parameters



# Now that we have moved away the entries TCPrint needs to send to the network server


# whatever is left on the command line are your command line arguments for formatting


# and the file to be printed. Remember, TCPrint does NOT do any formatting of the job.


# It invokes AIX’s piobe program to let the virtual printer do this work. Then
TCPrint


# sends the job across to the print server.




/usr/lib/lpd/piobe "$@" |
\



/usr/lpp/TCPrint/bin/TCPrint
-
h $HOSTNAME
-
p $TCPPORT
-
d $DELAY
-
s86400
-
w90 >> $DEBUGFILE 2>&1



if [ $?
-
ne 0 ]


then



exit 64


else



exit 0


fi


13


In our test scenario $
@

would refer to the remaining command line “
-
z+
-
w132 /my/file”


So piobe (the AIX Printer Input Output BackEnd) would be invoked to determine printer


initialization strings and format the job as specified by the AIX virtual print
er. When


the formatting is complete, the formatted output is then piped to TCPrint which is the


executable that is responsible for delivering the job to the print server via TCP/IP. The


hostname of the destination host ($HOST), the TCP port number on

which the job is to


be delivered ($TCPPORT) and a delay factor ($DELAY) are sent as arguments to the


TCPrint network client software. All output of TCPrint is send to standard output (stdout)


where it is redirected to the file specified in /etc/qconfi
g ($LOGFILE) when the queue was


created.



If TCPrint completes successfully, it will exit with a status of “0” to indicate its success.


This will cause the TCPrint.sh shell script to exit with a status of 0. This will tell the AIX


qdaemon that the job

completed successfully. The job is complete, and the next job queued


up can repeat the entire process. If however, TCPrint cannot deliver the print data to the


server, TCPrint with exit with a non
-
zero status. The TCPrint.sh shell script will in turn


exit with a status of 64. This value tells qdaemon that the job did not complete successfully.


This causes the queue to go DOWN but your job to remain queued at the top of the queue


so that when the problem has been corrected your job can be started a
gain.



The key reason that TCPrint has been divided into two parts, a shell script that is invoked


first, and a second executable program to do the network activities, is to allow system


administrators to modify and customize this shell script to meet
individual needs. Some


very clever modifications have been done by TCPrint users. A list of some of the most


interesting are included below for examples:



1. “I don’t want my jobs to pass through an AIX virtual printer. I want the job to be sent as
-
i
s



to my network printer.”




Though you can put the AIX virtual printer into a pass
-
thru unmodified mode, you could



also change the backend shell script to:



/usr/bin/cat "$@" |
\

/usr/lpp/TCPrint/bin/TCPrint
-
h $HOSTNAME
-
p $TCPPORT
-
d $DE
LAY
-
s86400
-
w90 >> $DEBUGFILE 2>&1



2. “My log file is growing very large. I don’t want to turn off logging but only want to see



a log entry if a print job fails.”




Change the TCPrint.sh script so that it overwrites instead of appends to the lo
g file.




/usr/lib/lpd/piobe "$@" |
\



/usr/lpp/TCPrint/bin/TCPrint
-
h $HOSTNAME
-
p $TCPPORT
-
d $DELAY
-
s86400
-
w90 >> $DEBUGFILE 2>&1




This way each job will overwrite the log file instead of appending to the log. When a queue



goes DOWN the log file will contain only the logging output for the last job.



3. “My print jobs stair
-
step across the page. How can I add carriage returns to linefeeds?”




Though this can be better accomplished through the AIX virtual printe
r, you can do it



with a utility like sed, awk, or tr. ( The ^M below is a control
-
m generated by typing



CTRL
-
V CTRL
-
M in a vi session.)


/usr/lib/lpd/piobe "$@" | sed 's/$/^M/g' |
\


/usr/lpp/TCPrint/bin/TCPrint
-
h $HOSTNAME
-
p $TCPPORT

-
d $DELAY
-
s86400
-
w90 >> $DEBUGFILE 2>&1




14


4. “I want to store a copy of each print job that goes through this queue into a directory for



archival purposes.”




First, build the FILENAME you want to use for the backup copy by whatever naming



convention you desire. Then, use the FILENAME as follows:


/usr/lib/lpd/piobe "$@" | tee /archive_directory/$FILENAME |
\

/usr/lpp/TCPrint/bin/TCPrint ...




5. “I want to log a file of each user that print a job to this queue.”




Somewhere wit
hin the /usr/lpp/TCPrint/bin/TCPrint.sh shell script:



echo $USER >> /your/log/filename




6. “I want to see the command line parameters being passed to the shell script.”





After the “#!/bin/ksh” line at the beginning of the script add a lin
e that reads:




echo $* > /tmp/command_line_flags







7. “I don’t want to use AIX print queues
-

I want to pipe data from my application to



the network printer.”




your_application | /usr/lpp/TCPrint/bin/TCPrint server port delay > o
utfile








These are just a few examples. Remember, you can make copies of this script and save


them under different filenames so that different queues can use different variations of the


script. Another file that may be altered is:



/usr/l
ib/lpd/pio/etc/TCPrint.config



(AIX 3.2.x only)



This file is used when you use “mkvirprt” or add a virtual printer through SMIT. It


contains the series of questions that you are asked when a queue is created and then


generates the queue entry into t
he /etc/qconfig file. You can copy this file to


yourfile.config and change the fields that are added to the /etc/qconfig file when


adding queues. Remember, TCPrint.sh backend script expects the parameters it


receives to be in a particular order and q
uantity. Any changes made to your qconfig


file must also be accomodated by modifications to the backend shell script TCPrint.sh.












15


Special notes regarding 3Com terminal servers




To setupa 3Com terminal server for use with TCPrint for AIX the s
erver must first be


given an IP address and then told on which TCP port number it should listen for incoming


print jobs.




To set the server IP address and netmask issue this command to the 3Com server:



setd
-
ip net = [ipaddress] [netmask]




The seco
nd step is to assign the BASE TCP PORT to to terminal server. 3Com suggests


a value such as 2000. This way to servers port 0 will listen for incoming print jobs on


TCP port 2000. Port 1 will listen for print jobs on TCP port 2001 and so forth. The


c
ommand to set the base port is:




setd
-
tcpappl tcbp=xxxx



where xxxx is the desired base value.













Special notes for Annex terminal servers




Annex terminal servers can use TCP ports 7001
-
7064 for raw communications in which


the server does n
o processing of the incoming data. For configuration of the terminal to


accept incoming print jobs please refer to the Bay Networks online documentation or their


manual
Remote Annex Administrator’s Guide

for UNIX (book A) (166
-
024
-
022
-
A). The


configur
ation for the RA and Annex product line should be the same for the features


required.















16


Special notes for Axis print server model NPS 540/640 and others



Axis NPS print servers can be printed to in a variety of means including RFC 1179 BSD s
tyle

LPR/LPD protocol. Axis servers also are capable of printing via reverse telnet protocol on a

configurable TCP port number. To configure the TCP port number the Axis servers listens to

follow these instructions from page 98 of the AXIS 540/640 Use
r's Manual:



1. Log into the AXIS 540/640 by typing the command:




ftp <axis_hostname>



2. Enter root as user id and pass as password.



3. Up
-
load the config file by typing:




get config



4. Edit the file using your preferred text editor.



Wit
hin the config file you will find a section resembling this sample:




---

TCPIP MENU



TCP_ENB. : YES



INT_ADDR. :



DEF_ROUT. :



NET_MASK. :



TCP_KEY. : 9514B5



PROS_PWD. :



PROS_PRT. : 35



LPD_BANN. : NO


BOOTP_EN
B. : YES



RARP_ENB. : YES



RTN_OPT. : YES



RTEL_PR1. : XXXX (where XXXX is the TCP port number that

RTEL_PR2. : you want the AXIS server to listen on



RTEL_PR3. : for print jobs to be printed to the



R
TEL_PR4. : logical printer port PR1)


RTEL_PR5. :



RTEL_PR6. :



RTEL_PR7. :



RTEL_PR8. :




Note that PR1
-

PR8 all print to the same PHYSICAL printer, but which LOGICAL printer you are

printing to determines what if any format
ting the AXIS server does on the data it receives. To

avoid both the AIX virtual printer and then the AXIS server from formatting print jobs, let the

AIX virtual printer do the formatting and print to a PR# that doesn't alter what it receives before

sending it to the printer.



5. Down
-
load the config file by typing:



put config CONFIG




It is important that the edited filename is specified in block capitals. Otherwise, the edits are

regarded as temporary and will be lost once the AXIS 560/66
0 has been powered down.






17


Special notes for DEC 700 terminal server




The information below has been provided by a customer using a DEC 700 terminal server


with TCPrint. We have not verified this information directly.



The example below shows how
to set up port 4 on the server to listen for incoming print


jobs on TCP port number 2004.




1. Log into the terminal server from a local terminal or telnet into the terminal server.


2. Enter the following commands local to the terminal server to set up
a port and give it



a connection address.



Local>

DEFINE PORT 4 ACCESS REMOTE


Local>

DEFINE PORT 4 DEFAULT PROTOCOL TELNET


Local>

DEFINE PORT 4 AUTOBAUD DISABLED


Local>

DEFINE PORT 4 AUTOPROMPT DISABLED BREAK DISABLED


Local>

DEFINE PORT 4 INACT
IVITY ENABLED


Local>

DEFINE PORT 4 SPEED 9600





(baud rate)


Local>

LOGOUT PORT 4


Local>

DEFINE TELNET LISTENER 2004 PORT 4 ENABLED


Local>

SET TELNET LISTENER 2004 PORT 4 ENABLED


Local>

DEFINE TELNET LISTENER 2004 IDENTIFICATION “PRINTER”


Local>

SE
T TELNET LISTENER 2004 IDENTIFICATION “PRINTER”


Local>

DEFINE TELNET LISTENER 2004 CONNECTION ENABLED


Local>

SET TELNET LISTENER 2004 CONNECTION ENABLED


Local>

SET PORT 4 TELNET SERVER NEWLINE TO HOST


Local>

DEFINE PORT 4 TELNET SERVER NEWLINE TO HOST



Jobs sent to this server’s IP address on TCP port 2004 should now print to port 4 on the


server. We are unsure of the function of the last two lines of this configuration... This


MAY be mapping carriage returns to newline or vice versa, which if this

is the case,


should be done by the AIX virtual printer, not the server itself.






Special notes for DigiBoard PortServer II




Digiboard PortServer ports can be configured to accept to types of incoming connections.


Either 2000 + port number for “data

port” or 2100 + port number for “raw port”. The


data port formats the data it receives. Since an AIX virtual printer will be formatting the


data before it is sent to the server, using TCP port 2100 + port number is preferred.



To set up the Digi for
remote printing in raw mode:



set port dev=prn ra=#



(where # is the physical port number)



set flow cts=on ixon=off ra=#


(to set the flow contol used)



After setting the above two settings, you should be able to telnet to the PortServer on


TCP port

2100 + port number and send data. If this works, TCPrint printing will as well.




18


Special notes regarding IBM 7318 S
-
20 servers



The IBM 7318
-
S20 terminal server can be printed to in several ways. One way to print to


the server is define a P10 style

port and print to the server via SPX/IPX. This limits


printing to only AIX systems. Other hosts cannot print to the server directly, but instead


must remote print to AIX to send across the network to the 7318. TCPrint may be used to


print to thes
e servers from AIX while allowing other platforms to print to the ports as well.

Below are the steps 7318
-
S20 owners have used successfully with TCPrint:




1) vi the S20 config file in /usr/lib/cns named <MAC_ADDRESS>.cfg



where MAC_ADDRESS is the
ethernet hardware address of the S20 with letters in



all lowercase. If such a file doesn’t exist copy the default config file to a file with the



above name rather than modifying the default configuration file.



2) Find the stanza that corresp
onds to the port on which you intend to add the printer.



Modify the stanza to look like the one below. The example below assumes port number



13 on the server:




[Port13]



mscreen=1



stty=9600



(the baud rate your printer is set to)



terminal
Type=dumb



escdef=1



tprint=0



3) ALL session entries for the 7318
-
S20 printer ports should look like this. The port field



can be 0
-
15 for serial ports or 1 and 2 for the two parallel ports.




[Session##]



where ## is the session number



port=
13




Again we assume the printer is on SERIAL port 13



session=0



application=reserved



device=LDTCOM



4) Set the number of telnet daemons the S20 is to run. This is the number of sessions that will



be running telnetd daemons listening for inco
ming TCP connections.




[Telnetd]



ntelnetds=##


(where ## is the number of telnet daemons)




5) Finally, change the Telnetd stanza for the port:




FOR SERIAL PORTS





FOR PARALLEL PORTS




[Telnetd##]





[Telnetd##]



device=COM





device
=LPT



port=13






port=1



(or 2)



tcpPort=####





tcpPort=####



mode=char








timeout=10000



The tcpPort value you used (generally 5100 + port number for serial ports) must match the


TCP port value used when configuring TCPrint print queues.



19



Special notes for Emulex



Emulex servers have one serial and one parallel port on them. Data sent to the Emulex


on TCP port 2501 goes to the parallel port. Data sent to port 2502 goes to the serial


port. If you telnet to the server on TCP port 204
8 you can login and view/edit the


configuration parameters of the Emulex server.









VII

Troubleshooting



IF NOTHING PRINTS
:


If you send your print job to the print queue and nothing comes out on the printer and “lpstat”

shows your job is RUNNING or

DEV_WAIT or that the queue went DOWN verify that you can

look up the print server’s hostname to an ipaddress with the command:


host <SERVER_HOSTNAME>

If the host command cannot return the IP address of the server’s hostname, then TCPrint won’t

be able
to find it either.


If you can look up the hostname of the server, try to ping the print server’s hostname.


ping <SERVER_HOSTNAME>

If you can’t ping the server, then TCPrint wouldn’t be able to connect to it either.


If you can ping the print server
, then try to telnet to the server on the port number you expect

TCPrint to send data to, ie “telnet serverhostname 9101” for port 2 of an HP JetDirect EX3.


telnet <SERVER_HOSTNAME> 9101

If telnet cannot connect to the server’s TCP port number, then TCP
rint won’t be able to either.



If you do get connected with telnet, try typing some text in and then exitting out of telnet. You

may need to hit a form feed to get a page eject from your printer after doing this. If the text you

typed doesn’t print, t
hen jobs sent by TCPrint cannot print either. One exception to this is if

your printer or plotter is PostScript or HPGL only and cannot print plain flat text files. In this

case, the printer or plotter will ignore what you type.


If any of these steps l
ead to nothing coming out on the printer, you may have a configuration

problem with the server or the TCP/IP configuration on your AIX system. Remember, the logging

output of TCPrint is an excellent source of finding out what happened with connections t
o your print

server.








20

IF JOB PRINTS BUT FORMATTING IS WRONG:


TCPrint does NOT perform any formatting of your print job. Print job formatting is done by

piobe and the AIX virtual printer subsystem. The formatted output of piobe is piped into TCPrint

(see the TCPrint.sh shell script) which sends the job across the network as
-
is. If you’re experiencing

formatting problems with your job, try these steps:


1) Disable the print queue and queue up a print job.

2) Examine the JDF (job description file) for

the job you submitted in /var/spool/lpd/qdir

3) cat, vi, more, or od
-
xc the file queued for printing according to the JDF file.


Does it match what you expected to get queued up to the queue?


4) Try qprt
-
Pqname
-
dp
-
j!
-
J! /your/file


This te
lls piobe not to format your job, or send any initialization sequences or restore strings to


the printer before or after the job. In other words, what gets queued up is exactly what gets sent


out of piobe and from there to goes to TCPrint.


5) Mod
ify the shell script /usr/lpp/TCPrint/bin/TCPrint.sh and change the line:


/usr/lib/lpd/piobe $* | /usr/lpp/TCPrint/bin/TCPrint $HOSTNAME $PORT .....


to


/usr/lib/lpd/piobe $* | tee /tmp/junk | /usr/lpp/TCPrint/bin/TCPrint $HOSTNAME $PORT ....




Then you can cat, more, vi, or od
-
xc the /tmp/junk file to see what piobe is doing to the job


that you queued up initially. This combined with step #3 will give you a view of what has


happened to your print data before TCPrint is ever invoked.


6) If your printer supports it, put the printer into hex dump mode to see byte for byte what the


printer is receiving.


7) If all else fails, trace the IP traffic between your host and the print server as follows:



iptrace
-
a
-
b
-
p <PORT>
-
s <AIX_
IP>
-
d <SERVER_IP> /tmp/trace

Send as small of a print job as possible that demonstrates your problem.

ps
-
ef | grep iptrace

Kill the iptrace process

ipreport /tmp/trace > /tmp/report


The /tmp/report is a report which will show all IP traffic betw
een the client and the server. If your

trace is empty, verify that you are tracing the correct IP addresses. If your AIX system has more than

one network interface card, you may have traced the IP address of the interface which isn’t used to

contact the
print server.













21

VIII

30
-
day evaluation copy



A 30
-
day evaluation copy of TCPrint is available. It is a fully functional version of the software


but 30
-
days from the time that the first print job is sent to a TCPrint queue, the software ceases


to allow printing. This is a great way to try out TCPrint to see if it will print to your XYZ print


server box without cost or obligation. This 30
-
day evaluation copy may be freely distributed to


anyone. Registered copies of the software (those not ha
ving a 30
-
day expiration period) may


not be distributed outside of the purchaser’s company or organization. See terms and licensing


information for full details.



If you purchase a registered copy of TCPrint a diskette will be shipped to you
containing the


registered copy of the software. To overwrite the evaluation software with a registered copy


which does not expire after 30 days, run the command:



tar
-
xvf /dev/fd0 /usr/lpp/TCPrint/bin/TCPrint



or if you received the software electr
onically instead of on diskette:



tar
-
xvf tcprreg.tar /usr/lpp/TCPrint/bin/TCPrint



Note that no reconfiguration will be required and queues created using the evaluation copy


of the software will continue to function normally after the registered cop
y has been installed.


IX

Pricing and support information



TCPrint is available for $199. This price is for site
-
wide access meaning that the software can


be installed on any system within your company or organization without additional charge.


Resell
er inquiries regarding volume discounts are welcome. The software is backed by a 90
-
day

money back guarantee; however, our liability shall not exceed the purchase price of the

software. Please see enclosed licensing agreement for full details. To orde
r submit payment to:






LAIX Software Consulting





PO Box 1001





Derby, KS 67037
-
1001




LAIX Software Consulting is not affiliated with IBM.




AIX is a registered trademark of IBM Corporation



All print server and terminal server devices mentioned

in this text are the registered


trademarks of their respective manufacturers.








22

LAIX Software Consulting

(800) 558
-
LAIX

PO Box 1001 Derby, KS 67037
-
1001

laixsoft@laixsoft.com

http://www.
laixsoft.com



Terms and licensing information for TCPrint an
d DIALprinter for AIX V3.2


Important: Read this before using the product.



Acceptance:

Use of this product indicates acceptance of the licensing terms outlined below:



Rights:

The software contained herein is subject to a “site
-
wide” licensing agreemen
t. Purchase of this

product constitutes the owner’s right to copy and to use the product on any system within the

purchaser’s company or organization regardless of location, but not to distribute the product outside of that
organization. The product may

not be transferred in possession to another company or

organization. You may not sub
-
license or lease this product to another company or organization.

The product may be modified or customized by the owner, or used by the owner in a manner other

than tha
t described in the documentation. The registered version of this software in its original or in a
modified state, may not be transferred, sold, or used in whole or in part outside of the purchasing
organization or company. Diskettes labeled with “30
-
day
evaluation copy” which actually contain the

30
-
day evaluation version of this software may be freely distributed.



Warranty:

The software is included under a limited warranty. LAIX Software Consulting warrants for a period

of ninety (90) days from the da
te of purchase that the diskette on which the software is recorded and

the software is free of defects and will function substantially as documented in the enclosed

documentation.



Limitation on Liability
:

LAIX Software Consulting assumes no liability fo
r damages, loss of profit, loss of data or information

of any kind or for consequential, special, indirect, incidental, punitive, or other damages caused by the use
of this product. Should the owner find that the product does not function as described i
n the documentation,
the product may be returned within a period of ninety (90) days of purchase for a full refund of the purchase
price. Upon request of a refund, the purchasers agrees to destroy or return all

copies of the software in their company or
organization’s possession.



Support:

Technical assistance with the installation, configuration, and usage of the enclosed software shall be free of
charge for a period of thirty (30) days from the date of purchase. Requests for technical assistance may b
e
submitted by telephone or fax to (800) 558
-
LAIX or by e
-
mail to laixsoft@
laixsoft.com
. No response time
criteria is guaranteed but LAIX Software Consulting will do its best to assist in a timely fashion. Support
for this product may be withdrawn at any

time after 30 days from the date of purchase.


Trademarks:

AIX
is a registered trademark of IBM Corporation

LAIX Software Consulting has no affiliation with IBM Corporation.