This document provides information for clearing a hung tty port in AIX 4.x.
For purposes of the following examples, the hung tty port is assumed to be tty0.
ps -ef | grep tty0
The preceding commmand would return something like the following:
root 12345 1 0 Aug 29 0 /path/program_name
The process ID (PID) here is "12345". To kill this process enter:
The command ps -ef | grep tty0 may be run again to determine whether the
process was successfully killed.
If the process still exists, (and it IS NOT a slattach process), try adding a -9 to the command.
kill -9 12345
Never use a -9 option to kill a slattach process because it may hang the AIX system.
NOTE: If the process is 'getty', use the following command to kill the process:
If the offending process has been successfully killed, but the tty is still unresponsive, go to step 2.
fuser -k /dev/tty0
This will kill any process that can be found running on the port and display the PID (process ID).
If the tty is still unusable, continue to step 3.
To determine the location of the port on which the tty is configured, enter the following command:
lsdev -Cl tty0
The third column in the output of this command indicates the address of the tty (for example, 'S1' below indicates the tty is configured for native serial port 1).
tty0 Available 00-00-S1-00 Asynchronous Terminal
If the tty is still unusable, go to step 4.
/usr/lbin/tty/stty-cxma flush tty0
This command is intended for tty's configured on ports of the 128-port adapter; however, in some cases it can be successfully used to flush other tty ports.
If the tty is still unusable, try step 5.
If the tty is still unusable continue to step 6.
Retrieve the major and minor numbers of the tty by entering:
ls -l /dev/tty0
The output should look like the following:
crw--w--w- 1 root system 44,129 Aug 28 13:12 /dev/tty0
The major and minor numbers are 44 and 129 respectively. To reset this tty enter:
/usr/sbin/strreset -M 44 -m 129
If the tty is still unusable try step 7.
rmdev -l tty0
This command leaves the information concerning the tty in the database but makes the tty unavailable to the system.
The following command reactivates the tty making it available to the system.
mkdev -1 tty0
If the tty is still unusable, consider moving the device (terminal, modem, etc.), to another port and configuring a tty at that location until the system can be rebooted. If a reboot does not clear the port, a hardware problem is indicated. Check the error report for port hardware problems by entering:
errpt -a | pg
NOTE: Some of the preceding commands will not work and they will give a method error indicating that the device
is busy. This is because of the process running on the tty. If none of the steps detailed above free the hung tty,
as a last resort, reboot the AIX box and flush the kernel so that the process will go away.
[ Doc Ref: 90605225114676 Publish Date: Jun. 22, 2000 4FAX Ref: 6833 ]