Previous | Table of Contents | Next |
Sometimes you need to eliminate a process entirely. Use the kill command to do this. The syntax of the kill command is kill -signal PID, where signal is a number or a name.
CAUTION! Kill a process only if you cannot get it to quit in the usual way.
Sometimes processes do not die when you use the kill command. The three most common cases are:
To kill a process:
For example, if OpenWindows is frozen on the system oak, you must log in remotely and kill the process from another system:
elm% rlogin oak Password: oak% ps -e | grep openwin PID TTY TIME COMD 2212 pts/Ø Ø:ØØ openwin 2213 pts/1 Ø:ØØ grep openwin oak% su Password: oak# kill 2212 oak# exit oak% logout elm%
The Solaris 2.6 release provides you with a set of commands that you can use to display detailed, technical information about active processes. These commands are summarized in Table 1-6.
Command | Description |
---|---|
pstop pid | Stop the process. |
prun pid | Restart the process. |
ptime pid | Time the process using microstate accounting. |
pwait pid | Wait for specified processes to terminate. |
pcred pid* | Display credentials. |
pfiles pid* | Display fstat and fcntl information for open files. |
pflags pid* | Show /proc tracing flags, pending and held signals, and other status information for each lwp. |
pldd pid* | Show dynamic libraries linked into each process. |
pmap pid* | Show address map space. |
psig pid* | Display signal actions. |
pstack pid* | Display hex+symbolic stack trace for each lwp. |
ptree pid | Show process trees containing specified PIDs. |
pwdx pid* | Display current working directory. |
*Must be superuser to execute.
NOTE: If you use the /usr/proc/bin commands frequently, add the process tool directory to your PATH variable to make the commands more easily accessible.
All of the /usr/bin/proc commands use the process ID (PID) as the argument to the command. You can obtain the PID by using the ps -e and the grep commands to search for the name of the process you want more information about. The following example displays the PID for the openwin process in the first column:
oak% ps -e | grep openwin PID TTY TIME COMD 2212 pts/Ø Ø:ØØ openwin 2213 pts/1 Ø:ØØ grep openwin oak%
Previous | Table of Contents | Next |