R2511-HP MSR Router Series Terminal Access Configuration Guide(V5)

58
Running and terminating ttyd on Unix server
Running ttyd
CAUTION:
W
ith automatic link establishment function confi
g
ured on the router, after you kill a child process and then
use ps-ef, you may still find a process correspondin
g
to the same pseudo terminal, which is actually a ne
w
process.
You can run the ttyd program after installation and configuration. After installing the device drivers and
configuring the configuration files, you can run the ttyd program as long as you can ping through the
router from the Unix server.
Execute the following command to run the ttyd program.
# /etc/ttyd
If you do not specify any parameters for the command, the default configuration file /etc/ttyd.conf is
used. To specify another configuration file, you must enter the file name in the following format:
# /etc/ttyd /etc/ttyd9020.conf
Or use the following command with no path specified to run the ttyd program in the installation directory:
# ./ttyd ttyd9020.conf
A Unix server can run multiple ttyd programs, each of which must use a unique configuration file and a
unique listening port.
You can enter the following command to view the version of ttyd.
# /etc/ttyd -h
Terminating ttyd
The ttyd program operates in multi-process mode. After you launch the program, you may find multiple
ttyd processes. You can enter this command to view information about processes:
# ps -ef | grep ttyd
In TTY one-to-one access mode, ttyd processes are in a two-tier process architecture, where the main
process is parent process 1 and the others are child processes. When you launch a ttyd program, a ttyd
main process is started. Whenever a TCP connection is established between the Unix server and a
terminal, a child ttyd process is started.
# ps -ef | grep ttyd
root 8312 8309 0 17:06:14 ? 00:00:00 /etc/ttyd ttyp40 10.110.96.44 6 /etc/ttyd9010.conf
1026
root 8313 8309 0 17:06:15 ? 00:00:00 /etc/ttyd ttyp41 10.110.96.44 7 /etc/ttyd9010.conf
1028
root 8309 1 0 17:06:11 ? 00:00:00 /etc/ttyd
The output reveals the relations between the processes:
Process 8309 is the first ttyd process launched, for its parent process is 1.
Processes 8312 and 8313 correspond to asynchronous interfaces with the terminal numbers of 6
and 7 on router 10.110.96.44 respectively, and their parent process is process 8309.
All processes use the default configuration file /etc/ttyd.conf.
You can use the kill 8309 command to kill the ttyd process 8309 and all its child processes, that is,
all the processes mentioned above.