C H A P T E R  4

Client Terminal

This chapter describes the most common client terminal problems. It includes the following topics:


Region Starts But Communication Servers Do Not

If Writing snapshot messages are displayed during startup, and the unikixmain.err file contains the following message:

ld.so.1: unikixCommMgr: fatal: libACE.so: open failed: No such file or directory

the LD_LIBRARY_PATH environment variable does not contain an entry for the $UNIKIX/lib directory. If this is the case, the region does start, but the Communications Manager process (unikixCommMgr) does not, and therefore, the communications servers it normally starts are not started. You will not be able to connect to the region through TN3270 emulators, MQSeries, or through SNA intersystem communications.

To correct the problem, modify $LD_LIBRARY_PATH in your region setup file so that it contains $UNIKIX/lib and restart the region.


TN3270 Sessions Do Not Connect

The most common TN3270 problems are:

Unable to Connect to Region Using PC-based TN3270 Client

Make sure you are licensed for the TN3270 server product.

You must start the unikixtne server from the user ID that started the Sun MTP region and specify the port number. If no options are specified, the default is port 2000 and the UNIX user ID and password facility is enabled.

Unable to Start unikixtne Server After the Region Is Restarted

If you restart a region and an error message is displayed stating that the port is already occupied when the unikixtne server attempts to start, follow this procedure.


procedure icon  To Clean Up unikixtne Process or Queues

1. Type the following command to see if a unikixtne server process exists:

$ ps -elf | grep unikixtne

2. If a unikixtne server process exists, delete it and restart Sun MTP.

If it does not exist, go to Step 3.

3. If the unikixtne server process does not exist, the queue entry might still exist. To determine if the queue entry exists, type:

$ ipcs -q | grep 0x0c

4. If a queue entry number is returned, remove the queue entry by typing:

$ ipcrm -q queue-number


Terminal or Keyboard Does Not Work on a Local Sun MTP Client

This section explains how to use the terminfo database to resolve terminal problems.

Creating and Installing terminfo Definitions

The tic command creates customized terminal terminfo definitions for use with the Sun MTP region. If an enhanced terminfo definition is provided for use with the region, the re-definitions of the terminfo files are in the directory $UNIKIX/etc. You can identify them by the .tic file name suffix. These files allow the Sun MTP screen to display the status line at the bottom of the screen instead of at the top.


procedure icon  To Use the tic Command to Put a Terminal Definition Into the Standard terminfo Directory Structures

1. To change the system terminfo database located in /usr/lib/terminfo, you need root access.

For example, if the site uses X server terminals, log in as root or superuser, and then type:

$ cd $UNIKIX/etc
$ tic xterms.tic

If you cannot log in as root, see your UNIX system administrator.

2. If a tic file does not exist for a terminal type, you can create it with the infocmp or untic command. For example:

$ infocmp /usr/lib/terminfo/x/xterms > xterms.tic

3. Edit the tic file you just created, then compile it with the tic command:

$ tic xterms.tic
$ exit

4. To create your own terminfo database (for which you do not need root access) set the environment variable TERMINFO to point to a directory. For example:

$ TERMINFO=$UNIKIX/terminfo; export TERMINFO
$ tic custom-termname.tic

The tic command then compiles a terminfo file into a database in $UNIKIX/terminfo/c/custom-termname. The name of the file created in the terminfo directory hierarchy is obtained from the first field of the first non-comment line in the tic file.

To use your own definition, set the variable TERMINFO before you start the region, or start the region with the unikix -k option set to the new terminal name.

Consider storing any changed terminfo descriptions in $UNIKIX/local/lib so they are not overwritten and can be applied to later releases of the operating system.

If your system runs only one region, you can edit the supplied files to simplify configuration. However, you can lose these changes when the next revision of the operating system software is installed. Therefore, keep a copy of any modified standard files in the $UNIKIX/local directory structure. You should also copy the original files before editing them in case you need to recover from editing errors.

Changing Application Keypad Mode Settings With terminfo

Applications that use curses and the terminfo terminal definitions, sometimes issue a terminal reset or initialization before terminating. This can cause terminal settings that were in effect before the application's execution to be set to some arbitrary condition instead of the condition that existed before the application's execution. Unfortunately, there is no mechanism to record the terminal's previous settings and restore them.

For example, if the application keypad was enabled before calling vi from within the region, it is reset on exiting vi. It will appear as if the Attention Identifier (AID) keys on the keypad no longer work or that they generate incorrect sequences.

The best solution is not to reset the terminfo definition for this TERM value to the application keypad mode of operation. Using the infocmp command, you can capture and examine the current contents of the terminfo definition. Change the entries that contain the reset application keypad mode and apply the changes to the terminfo catalog using the tic command. See Creating and Installing terminfo Definitions for information about using infocmp and tic.

The sequences that cause a terminal to enter and leave application keypad mode are terminal specific. For a VT220 terminal, \E> clears this mode, and \E= sets it. The sequence occurs in several of the terminfo entries; for example, -is2 and -rmkx. In addition, terminfo files for the same terminal type from different vendors, and on different product lines from the same vendor, can have different terminfo definitions. Refer to the vendor's technical reference manual for the specific terminal for the terminal sequences.

Verifying terminfo Values

To verify that terminfo values are correct for the COBOL Animator, find a system that works with Animator or obtain a copy of a tic file for a terminfo entry that works with Animator, and check the values against the values in your tic file. See Creating and Installing terminfo Definitions.

The tic files contain the terminal name as the first field of the first non-comment line, followed by definitions for various keys. If, for example, the value for the up arrow key is equal to \EOD (keyword kcuu1=\EOD) in the working file, it must be the same in your tic file.

TABLE 4-1 lists the keywords from a tic file for the arrow keys (important for correct operation of Animator) for application and cursor mode. Animator expects the keys to function in cursor mode. The terminfo man page lists all keywords.

TABLE 4-1 Keyboard Definition Keywords

Definition

Keyword
(Application Mode)

Keyword
(Cursor Mode)

Up arrow key

kcuu1

cuu1

Left arrow key

kcub1

cub1

Right arrow key

kcuf1

cuf1

Down arrow key

kcud1

cud1

Function keys F1-F12

kf1-kf12

 



procedure icon  To Use a Particular terminfo Definition

single-step bulletSet the TERM environment variable to the terminfo name before invoking the client that uses curses.

Do this in the user's .profile or .login file (TERM=term or setenv TERM term), or you can specify it with the -tn option to xterm. You can also issue a shell command to set the TERM environment variable.


Numeric Keypad Is Not in Application Mode

Sun MTP requires the numeric keypad of the keyboard to be in application mode. In this mode, the minus key performs a keyboard Reset, and the plus key transmits a Clear. After an abort, however, your terminal might be left in numeric mode. To make recovery from this situation easier, create script files that reset the keypad from one mode to another.

The two procedures that follow show how to create script files that:

These procedures show the key sequences for VT100-, VT220- or VT320-mode terminals. If you are using another terminal type, refer to the terminal documentation for the reset sequences.


procedure icon  To Create a Script That Resets the Keypad to Application Mode

1. In vi or any other text editor, create a file called appl (or any name you choose).

2. Type the text of the script file:

a. Type the word echo, then a space.

b. Press the Shift key and the 6 key to insert a carat character (^) into your file.

c. Type the [ character.

d. Type an equal sign character (=).

e. Press the Escape key to exit from insert mode.

The contents of the file should be as follows:

echo ^[=

3. Save the file and exit the editor.

4. Make the file executable, and then execute the file to reset the keypad to application mode.

$ chmod 777 appl
$ appl


procedure icon  To Create a Script That Resets the Keypad to Numeric Mode



Note - In numeric mode, the minus key produces a minus sign and the plus key produces a plus sign.



1. In vi or any other text editor, create a file named num (or any name you choose).

2. Type the text of the script file:

a. Type the word echo.

b. Press the Shift key and the 6 key to insert a carat character (^) into your file.

c. Type the [ character.

d. Type a greater-than character (>).

e. Press the Escape key to exit from insert mode.

The contents of the file should be as follows:

echo ^[>

3. Save the file and exit from the editor.

4. Make the file executable, and then execute the file to reset the keypad to numeric mode.

$ chmod 777 num
$ num


Arrow Keys Are Not in Cursor Mode for Animator

To correctly operate the COBOL Animator, the arrow keys must be in cursor mode. This is the case during the normal operation. However, should either Sun MTP or Animator end abnormally, the cursor keys might be left in application mode.

You can create a script to reset the arrow keys to cursor mode. The steps in this procedure show the key sequences for VT100-, VT220- or VT320-mode terminals. If you are using another terminal type, refer to the terminal documentation for the reset sequences.


procedure icon  To Create a Script That Resets the Arrow Keys to Cursor Mode

1. In vi or any other text editor, create a file named curs (or any name you choose).

2. Type the text of the script file:

a. Type the word echo.

b. Press the Shift key and the 6 key to insert a carat character (^) into your file.

c. Type the [ character into your file.

d. Type the following characters: [?1l

e. Press the Escape key to exit from insert mode.

The contents of the file should be as follows:

echo ^[[?1l

3. Save the file and exit from the editor.

4. Make the file executable, and then execute the file to reset the arrow keys to cursor mode.

$ chmod 777 curs
$ curs

To create another script that resets the arrow keys to application mode, follow the preceding procedure, but change the contents of the file to contain this line:

echo ^[[?1h


Can Connect to Sun MTP Only From the User ID That Started It

Sun MTP is started from a particular user ID and other users with different user IDs cannot connect to the region.


procedure icon  To Resolve This Problem

1. Verify that the KIXSYS environment variable is set properly.

2. Make sure you have read permissions (at a minimum) on the $KIXSYS directory.

3. Determine if you need to supply the -Q option to unikixmain when starting.

Refer to the Sun Mainframe Transaction Processing Software Reference Guide for a description of the unikixmain startup options.

4. Make sure that you configure the unikixl and unikixstrt modules to be owned by root and have the setuid bit set.

These two modules are generally in the $UNIKIX/bin directory.

For example, to change the owner and permissions on the unikixl and unikixstrt modules, type the following commands:

# chown root unikixl
# chmod 4755 unikixl
# chown root unikixstrt
# chmod 4755 unikixstrt


Sun MTP Client Terminates Abnormally

A user's Sun MTP client might terminate abnormally under the following conditions:

Because UNIX clients use curses, the terminal description might be left in an unusual state when a client terminates abnormally. You can correct this with the stty command. To automate the process, add the following statements to each user's .profile:

stty -g > $HOME/.stty
sane(){
	stty `cat HOME/.stty`
}

The first statement saves the state of the terminal at log in. The second statement sets up a command, sane, that the user can execute when needed. This command resets the terminal to the login state. After an abnormal abort, the user can type sane followed by Ctrl-J to return to the proper state. Typing Ctrl-J is required because the Return key might not work.

After the terminal returns to the proper state, the user can log in to the region again.