Major Hayden has a nice post on SIGTERM and SIGKILL.
Here I sum it up. When you execute “
kill 123“, it sends a SIGTERM signal to process 123. In this case the process has a chance to clean up (e.g. free resources) before exiting. The brutal “
kill -9 123” sends a SIGKILL signal and terminates the process immediately, i.e. no time for cleaning up. Be nice and first try SIGTERM.
In Python, you can kill a process the following way:
import os import signal os.kill(pid, signal.SIGTERM)
Geek rap “kill -9″
At the Racker Hacker blog you can find several posts related to server administration.