ruk·si

Linux
Shut Down Processes

Updated at 2015-08-08 20:14
ps -ax | grep foreman # Find the process id, replace the "foreman"
kill 9619             # Clean kill using cancel.
kill -1 9619          # Semi-clean kill similar to logout.
kill -9 9619          # Ugly kill right away.
kill `pgrep process_name`

Loop until the process is dead.

if [ `pgrep -n -f [s]upervisord.conf || echo 0` != 0 ]; then \
    while `echo pgrep -n -f [s]upervisord.conf`; \
        do kill `pgrep -n -f [s]upervisord.conf`; \
        sleep 0.5; \
    done; \
fi; \
supervisord -c /etc/supervisord.conf