Normally, you use the kill command to end a process.
The kill command sends a signal to the designated process. Depending on the type of signal and the nature of the program that is running in the process, the process might end or might keep running. The signals you send are:
|SIGTERM||(signal 15) is a request to the program to terminate. If the program has a signal handler for SIGTERM that does not actually terminate the application, this kill may have no effect. This is the default signal sent by kill.|
|SIGKILL||(signal 9) is a directive to kill the process immediately. This signal cannot be caught or ignored.|
kill -term ProcessID
kill -kill ProcessID
<defunct>in the CMD column. For example:
Zombie processes continue to exist in the process table until the parent process dies or the system is shut down and restarted. In the example shown above, the parent process (PPID) is the ksh command. When the Korn shell is exited, the defunct process is removed from the process table.
UID PID PPID C STIME TTY TIME CMD . . . lee 22392 20682 0 Jul 10 - 0:05 xclock lee 22536 21188 0 Jul 10 pts/0 0:00 /bin/ksh lee 22918 24334 0 Jul 10 pts/1 0:00 /bin/ksh lee 23526 22536 22 0:00 <defunct> lee 24334 20682 0 Jul 10 ? 0:00 aixterm lee 24700 1 0 Jul 16 ? 0:00 aixterm root 25394 26792 2 Jul 16 pts/2 0:00 ksh lee 26070 24700 0 Jul 16 pts/3 0:00 /bin/ksh lee 26792 20082 0 Jul 10 pts/2 0:00 /bin/ksh root 27024 25394 2 17:10:44 pts/2 0:00 ps -ef
Sometimes a number of these defunct processes collect in your process table because an application has forked several child processes and has not exited. If this becomes a problem, the simplest solution is to modify the application so its sigaction subroutine ignores the SIGCHLD signal.