Custom Signals

ddollar edited this page Jan 4, 2012 · 1 revision

Foreman uses SIGTERM by default to alert processes that they need to shut down. If you need to use an alternate termination signal, you can use a wrapper script:


# trap TERM and change to QUIT
trap 'echo killing $PID; kill -QUIT $PID' TERM

# program to run
bin/daemon &

# capture PID and wait