This document contains information on how to clear a hung tty port in both AIX 3.2 and 4.1.
For purposes of the following examples, the hung port tty is assumed to be tty0.
ps -ef |grep tty0
For example, the command above 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:
kill 12345
The command ps -ef |grep tty0 may be run again to determine whether the process was successfully killed.
Note: If the process is 'getty', use the following command to kill the process:
pdisable tty0
In the event 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) of that process.
If the tty is still unusable please continue.
To determine the location of the port on which the tty is configured, use:
lsdev -Cl tty0
The third column in the output of this command, indicates the address of the tty (e.g., '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 continue.
/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 continue.
If the tty is still unusable continue.
Get the major and minor numbers of the tty by typing:
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 type:
/usr/sbin/strreset -M 44 -m 129
If the tty is still unusable continue.
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 typing:
errpt -a |pg