Terminating or killing a process

Send a TERM signal (SIGTERM) to the process to terminate gracefully, by requesting that it do so.

kill -TERM pid

Or:

kill -15 pid

Where pid is the process identifier.

Send a KILL signal to force the termination:

kill -KILL pid

Or:

kill -9 pid

pid file

Some programs keep their pid in a file, e.g. the mongrel server. In this case you can cat the file into kill:

kill -TERM `cat ~/app/tmp/pids/server.pid`

This is useful in bash functions, in this case allowing you to create start/stop functions for each mongrel web application.

Last modified: 03/06/2012 Tags: ,

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top