; supervisor config file
; modified

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)
; The only purpose of this file is to silent "CRITICAL" error
; when starting up, see https://github.com/Supervisor/supervisor/issues/694
username = dummy
password = dummy

[supervisord]
logfile=/dev/null ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket
username = dummy
password = dummy

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[eventlistener:stdout]
command = supervisor_stdout
buffer_size = 4096
events = PROCESS_LOG
result_handler = supervisor_stdout:event_handler

[program:uwsgi]
command = /usr/bin/uwsgi --ini /etc/uwsgi/apps-enabled/weblate.ini
environment = UWSGI_DEB_CONFNAME="weblate",UWSGI_DEB_CONFNAMESPACE="app"
stdout_events_enabled=true
stderr_events_enabled=true

[program:check]
command = /usr/local/bin/weblate check --deploy
autorestart = false
stdout_events_enabled=true
stderr_events_enabled=true
exitcodes = 0,1

[program:nginx]
command = /usr/sbin/nginx -g "daemon off;"
stdout_events_enabled=true
stderr_events_enabled=true

[program:celery-main]
environment = CELERY_WORKER_RUNNING=1
command = /usr/local/bin/celery worker --hostname 'main@%%h' --app weblate.utils --loglevel info --queues=celery --prefetch-multiplier=4 --concurrency={{ weblate_celery_main_concurrency }} %(ENV_CELERY_MAIN_OPTIONS)s
stdout_events_enabled=true
stderr_events_enabled=true

[program:celery-notify]
environment = CELERY_WORKER_RUNNING=1
command = /usr/local/bin/celery worker --hostname 'notify@%%h' --app weblate.utils --loglevel info --queues=notify --prefetch-multiplier=10 --concurrency={{ weblate_celery_notify_concurrency }} %(ENV_CELERY_NOTIFY_OPTIONS)s
stdout_events_enabled=true
stderr_events_enabled=true

[program:celery-memory]
environment = CELERY_WORKER_RUNNING=1
command = /usr/local/bin/celery worker --hostname 'memory@%%h' --app weblate.utils --loglevel info --concurrency={{ weblate_celery_memory_concurrency }} --queues=memory --prefetch-multiplier=4 %(ENV_CELERY_MEMORY_OPTIONS)s
stdout_events_enabled=true
stderr_events_enabled=true

[program:celery-translate]
environment = CELERY_WORKER_RUNNING=1
command = /usr/local/bin/celery worker --hostname 'translate@%%h' --app weblate.utils --loglevel info --queues=translate --prefetch-multiplier=4 --concurrency={{ weblate_celery_translate_concurrency }} %(ENV_CELERY_TRANSLATE_OPTIONS)s
stdout_events_enabled=true
stderr_events_enabled=true

[program:celery-backup]
environment = CELERY_WORKER_RUNNING=1
command = /usr/local/bin/celery worker --hostname 'backup@%%h' --app weblate.utils --loglevel info --concurrency={{ weblate_celery_backup_concurrency }} --queues=backup --prefetch-multiplier=2 %(ENV_CELERY_BACKUP_OPTIONS)s
stdout_events_enabled=true
stderr_events_enabled=true

[program:celery-beat]
environment = CELERY_WORKER_RUNNING=1
command = /usr/local/bin/celery beat --app weblate.utils --loglevel info --concurrency={{ weblate_celery_beat_concurrency }} --pidfile /run/celery/beat.pid %(ENV_CELERY_BEAT_OPTIONS)s
stdout_events_enabled=true
stderr_events_enabled=true
