I try kill <pid> but program still appearws if I use ps
Hello
I ran a server program (ie a program which runs and never stops) and after a while used Ctrl Z to stop the program. Then I looked at running processes using ps and found it was listed there. so I noted the pid and ran kill <thepid>. no error seen in doing this. Then I check using ps again and program is still listed? Does this mean the program is still actually running? Or does it show recent processes? Or am I doing something wrong? Angus |
@ Reply
Hi Angus,
Welcome to LQ!!! You have to send kill signal to terminate the process. You can do this using following command: Code:
kill -9 <pid of that process> |
type this command and check the output
Code:
#jobs |
Quote:
You can also type: Quote:
Or Quote:
|
Quote:
|
Quote:
and next time use this command to look out for stopped or zombie process before you reach to a conclusion that you have sucessfully killed any process Code:
#jobs |
Quote:
|
@ Reply
You're welcome.
Yes, you are right that no program can trap KILL SIGNAL. Enjoy linux!!! |
When processes are killed with SIGKILL they have no opportunity to clean up before they stop so data may be lost and files may be left in an uncoordinated state. For these reasons, if the application can be stopped by any other signal, that signal should be used. SIGKILL is a last resort (unless you want the process to have no opportunity to save its data :D ).
|
All times are GMT -5. The time now is 02:14 PM. |