publik-devinst/roles/app-setup/templates/server-supervisor.j2

29 lines
978 B
Django/Jinja

[program:{{server_app_name}}]
; Concurrency set to 1 because there is no lock around calls to hobo_notify
command={% if 'manage_cmd' in app %}{{app['manage_cmd']}}{% else %}{{venv_python}} {{src_dir}}/{{app['name']}}/manage.py{% endif%} runserver {{app['server_port']}}
environment={{app['settings_env_var']}}="{{app_settings}}"
process_name={{server_app_name}}
user={{user}}
numprocs=1
stdout_logfile=/var/log/{{server_app_name}}/stdout.log
stderr_logfile=/var/log/{{server_app_name}}/stderr.log
autostart=true
autorestart=true
startsecs=10
; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600
stopsignal=KILL
; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true
stopasgroup=true
; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998