File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,14 +73,14 @@ sudo -E -u deis ./manage.py syncdb --migrate --noinput
7373# spawn a gunicorn server in the background
7474sudo -E -u deis gunicorn -c deis/gconf.py deis.wsgi &
7575
76- # smart shutdown on SIGINT and SIGTERM
76+ # smart shutdown on SIGTERM ( SIGINT is handled by gunicorn)
7777function on_exit() {
7878 GUNICORN_PID=$( cat /tmp/gunicorn.pid)
7979 kill -TERM $GUNICORN_PID 2> /dev/null
8080 wait $GUNICORN_PID 2> /dev/null
8181 exit 0
8282}
83- trap on_exit INT TERM
83+ trap on_exit TERM
8484
8585# spawn confd in the background to update services based on etcd changes
8686confd -node $ETCD -config-file /app/confd.toml &
Original file line number Diff line number Diff line change 77errorlog = '-'
88accesslog = '-'
99access_log_format = '%(h)s "%(r)s" %(s)s %(b)s "%(a)s"'
10+
11+
12+ def worker_int (worker ):
13+ """Print a stack trace when a worker receives a SIGINT or SIGQUIT signal."""
14+ worker .log .warning ('worker terminated' )
15+ import traceback
16+ traceback .print_stack ()
17+
18+
19+ def worker_abort (worker ):
20+ """Print a stack trace when a worker receives a SIGABRT signal, generally on timeout."""
21+ worker .log .warning ('worker aborted' )
22+ import traceback
23+ traceback .print_stack ()
You can’t perform that action at this time.
0 commit comments