In my first Linux Letter column, I asked for topic suggestions--and did I ever get them!
Judging by the volume of responses I received (for which I am grateful), I gather that many of you are ready to take the plunge but are unsure of how to integrate Linux into the same network as your iSeries. In fact, the number one topic suggestion was that I describe connectivity between a Linux box and the iSeries. This theme varied--from questions about 5250 emulation to questions about iSeries database access. Since almost everyone with an iSeries has an occasional need for green-screen access, I'll begin the connectivity series by introducing you to a 5250 emulator that shows the power and beauty of the open-source model. As an added benefit, you'll learn how to install "tar ball" software (from source) on your machine and get a taste of the Concurrent Versioning System (CVS). (Tar balls are so named because of the tool used to create the file--Tar.)
For the purpose of this discussion, I'll make the following assumptions about your Linux system: 1) that you already have Linux installed and configured for TCP/IP; 2) that the Linux box and iSeries can communicate with each other (use the ping utility from either machine to verify this); 3) that the Linux machine has access to the Internet; and 4) that you installed the development tools on your Linux machine during installation. You'll need the GNU C compiler as well as automake, autoconf, libtool, and ncurses. Check your distribution's documentation to learn how to verify whether or not you have the tools installed. If you don't, that same documentation will provide instructions for their installation.
The emulator software that I'll be using for this column is called tn5250. This is a prime example of open source: programmer has a need for a *nix-based emulator (in this case, the programmer is Michael Madore); programmer starts the project and tosses it out on the Internet; other programmers pick it up and start contributing their own bits and pieces. The result is the collaborative effort that we're now discussing. The tn5250 software is not the only emulator available for Linux (a commercial, Java-based emulator is available from MochaSoft, and there are other platform-specific commercial products out there as well), but what I really like about tn5250 is the depth of the product and the fine people who actively contribute to the project and its mailing list (also available at the Source Forge URL listed below). The product is rock solid. I've used it daily for more than a year, and it has worked without a hitch.
If you check the tn5250 project site, you'll note that there are three methods for obtaining the software:
- Retrieve the stable source and compile it yourself.
- Retrieve the latest development source and compile it yourself.
- Retrieve binary (recompiled) versions for specific distributions and install them. Binaries are convenient for anyone not wishing to "roll his own." In this case, binaries are available for the Red Hat and Debian distributions. Both Red Hat's RPM program and Debian's apt-get program, which are used to install the binary packages, allow you to maintain a software inventory on your system in a manner functionally equivalent to the iSeries' GO SOFTWARE suite. Thus, selecting a binary is the most expedient way to get going, but it's not as much fun!
I use the development source because of a problem I had with a System/36 (I'm not kidding) passthrough session. The stable version choked on POP (you old-timers know what I'm talking about), but the development version had a fix that corrected the problem. Which version you choose is up to you. If you don't get a warm, fuzzy feeling from using development versions of software, then, by all means, get the stable version. If, however, you're more adventurous, retrieve the development version. Let's look at both choices.
It's time to get your hands dirty. First, open a terminal session (a Gnome terminal or a Konsole session), which should land you in your home directory. Create a directory into which you'll place your source code by issuing the following command:
Then, change to the directory with
Now, open another browser window and point it to the home of tn5250 (http://tn5250.sourceforge.net/).
Getting the Stable Source
Under the heading "Getting tn5250," you'll find a link for the tn5250 files list. If you're interested in the stable code, click on the link; you'll be taken to the page shown in Figure 1. Hold down your shift key (to indicate that you want to download the file) and click on the link for 0.16.3. Download the file (which will be named tn5250-0.16.3.tar.gz) into the directory you created earlier.
Figure 1: From this Web page, you can download the stable code for tn5250.
Now that the tar ball is on your drive, you need to extract the source. Tar is a program that, in function, is like PKZIP in that it acts as a file packager. However, the name really is a contraction for Tape ARchiver, indicating its original use. The ".tar" portion of the filename extension indicates that Tar was used to create the file, just as ".zip" is commonly used to indicate that a file was created by PKZIP or one of its clones. The ".gz" portion indicates that the contents within the tar ball were compressed using the gzip utility. Sometimes these two extensions are used in the shorthand form ".tgz." In either case, use the following command to extract the files:
Return to your terminal session and issue the Tar command now. If you're interested in what the switches (parameters) in this command mean, simply issue either of these commands:
man tar (to read the manual page)
or
tar --help (to obtain the condensed help)
Once you've untarred the tar ball, you should find in your directory (using ls) another directory called tn5250-0.16.3. Change to that directory (cd tn5250-0.16.3) and wait while I get the source code for those who like to straddle the bleeding edge.
Getting the Development Source
The tn5250 project, like most open-source projects, uses the CVS to manage its source. CVS has been used for years as a means to allow multiple developers to work on the same project simultaneously. Furthermore, it permits branching within one project, which allows the user to pick any version in the development tree. Among its many capabilities is that of anonymous access, whereby anyone can obtain the current or past version, even if they aren't otherwise authorized to post updates to the project.
The instructions for obtaining the development source are on the Web page under "Getting tn5250" and are included in the following instructions:
To check out tn5250 via anonymous CVS, enter the following commands. When asked for a password for "anonymous," just press Enter.
cvs -z3 -d:pserver:
The first CVS command logs you onto the CVS server, and the second retrieves ("checks out" in CVS parlance) the latest version of the source. Once you've watched all of the files scroll past as the source is brought to your system, you should find in your current tn5250 directory another called tn5250. Change to that second tn5250 directory:
Then, issue the following command:
Unlike DOS or Windows, *nix doesn't put the current directory in its search path when executing binaries. So the leading ./ is used to tell the operating system that you want it to execute automake.sh, which is located in the current directory.
One other thing: during the execution of automake.sh, you may get the rather intimidating error message "configure.in: 7: required file `./ltconfig' not found." If so, simply reissue the ./automake.sh command.
Compiling the Source
At this point, the instructions for compiling and installing the software are identical for both versions. Begin by issuing the following command:
./configure
This command examines the environment upon which it is running and creates the Makefile (which is used by a program called make that will invoke the actual compilation--and more--for you). Start the compilation simply by typing make, and wait while the source files are compiled and linked to create the executables.
The final step requires that you be logged on as the root user, since the installation script will be placing the resulting binaries and documentation into system directories. Switch to the root user by typing su and then respond to the password prompt. Now, issue the following command:
make install
Once again, you'll be mesmerized as all that text goes scrolling by (which sure beats a dull status bar!). Return to your previous user id by typing exit. Now you're ready to test-drive the emulator.
Testing 1-2-3
Although you may wish to do some additional customization steps (as noted in the documentation included with the software), you can now invoke the emulator by issuing this command:
When prompted, fill in the name of your iSeries and press Enter. You now should be looking at an emulator screen similar to Figure 2. If you are, congratulations! You've just installed your first program from source. In the unlikely event that it doesn't work as expected, keep reading. I'll discuss your help desk options shortly.
Figure 2: Voila! Here's your 5250 emulator screen!
Documentation? Yeah, We Have That!
To the user, one of the most important facets of a software package is documentation. Unfortunately, many open-source projects are somewhat lacking in this department. It isn't that there is no documentation. Rather, open-source projects rarely have a technical writer and graphic artist; hence, the lack of a polished manual in either printed or PDF form. But all is not lost. For the popular open-source software--such as Sendmail, Apache, or even the VI Editor--books are available from various publishers. But for the smaller projects or those with a limited audience (such as tn5250), the docs are typically limited to a man page (man tn5250) installed with the software, as well as two files that are worth taking your time to read: INSTALL and README. (Note: INSTALL may be omitted with a binary distribution.) The README file typically contains some of the basic information concerning the software, such as its purpose or its software prerequisites. You may use the less or more commands to view either of them, since they are just text files. Simply type less INSTALL (case important!) or less README to browse the information.
If you are having difficulties installing or using the software, use the Internet to your advantage. With this project, as with most others, you'll find listed somewhere in the documentation a mailing list devoted to the project. In the case of tn5250, a quick scan of the documentation from the README file shows the following information:
http://tn5250.sourceforge.net/ - linux5250 Homepage
http://www.midrange.com/linux5250.shtml - linux5250 List Info
http://archive.midrange.com/linux5250/index.htm - linux5250 List Archives
http://sourceforge.net/projects/tn5250/ - linux5250 at Sourceforge
http://perso.libertysurf.fr/plinux/tn5250-faq.html - linux5250 FAQ
Responses to help requests are typically swift and incisive.
Tweaking and Configuration
Although there are many options available to you (such as specifying the number of columns or instructing tn5250 to report to the iSeries that it is one of a number of different IBM terminal types), you can use just the default values successfully. If you read the docs, you'll note that you can store your choices in a configuration file or submit them as command line parameters when you invoke xt5250. I chose the latter and embedded them into a script that starts four 80-column instances of the emulator followed by one 132-column instance. This script is shown in Figure 3. I'm not going to cover how the script works in this month's column. If you're interested, type man bash and man tn5250 to follow it.
|
Figure 3: This simple script starts a total of five emulator sessions.
Be aware that Client Access Express connections use encryption when connecting to the iSeries so that the user ID and password are obscured before traveling over the network. This program, by default, does not. Thus, anyone with a packet sniffer could watch your communications. However, you can configure tn5250 to encrypt its communications, too. The instructions are in the file README.ssl. If you look back at Program 1, you'll note that I differentiate between the two systems because one is configured for encryption and one isn't, which changes the command line parameters used.
Go Forth and Emulate
There you have it--a nice 5250 emulator that not only is free but also doesn't encumber your Client Access user count. And it's a fine example of open source in action.
Most of the time, you'll use binary packages to add software to your Linux machine (assuming that you use a popular distribution which supports them). But when one isn't available for the software or distribution that has caught your eye, you'll be happy to know that nearly all tar ball programs are compiled and installed using the same steps used during the installation of this one: ./configure, make, and finally (as root) make install. What you've learned during the installation of tn5250 is applicable to much of the other software you'll compile. Just be sure to read the INSTALL file before you begin. And, in case you are curious, you can typically remove a program so installed by issuing the command make uninstall from within the directory where you originally ran make install. Clean-up is, therefore, relatively painless.
As always, I welcome your comments and suggestions. Feel free to send them to
LATEST COMMENTS
MC Press Online