sometimes the /usr/sbin/strreset -M 44 -m 129
works sometimes it does not
Sometimes the stty-cxma command works...sometimes it doesn't
/usr/lbin/tty/stty-cxma flush <tty0>
If you are talking an active system with lots of users...you certainly don't want to play...cuz the result will be a reboot if it is still hung....and if we are talking a lot of ports...you don't want to do this every time...but read on...maybe it will help you.
-----------------------------------------------------------------
How To Clear A Hung tty Port
For purposes of the following examples, the hung port tty is assumed to be
<tty0>.
1. Determine whether the tty is currently handling any processes:
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.
2. Type:
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.
3. Detach and re-attach the cable from the hung port. AIX uses the DCD (Data
Carrier Detect) signal to determine the presence of a device attached to
the port. By dropping DCD, detaching and re-attaching the cable will in
many cases clear hung processes.
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.
4. Flush the port by using stty-cxma:
/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.
5. On the keyboard of the hung terminal press the Q key while holding down
the Ctrl key. This will resume any suspended output by sending an Xon
character.
If the tty is still unusable continue.
6. If the unresponsive tty is on an AIX 3.2.x system, skip to step 7. As the
AIX 4.x tty subsystem is STREAMS based, one can use strreset to reset the
stream (this command does not exist on AIX 3.2.x systems).
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.
7. Bring the tty down to a DEFINED state and then make it available. A
program will sometimes open a tty port, modify some attributes, and when
closing the port, it does not reset those attributes type:
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