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.