Talk is cheap

Files:

1
2
3
4
> tree
.
├── requirements.txt
└── supervisord

++File requirements.txt++

1
supervisor>=4.1.0

1. Install

Install supervisord by pip3, in your terminal run this

pip3 install -r requirements.txt

2. The .conf

Write supervisord.conf for yourself. In this case, it would be check the status of gunicorn.

++File supervisord.conf++

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

[supervisord]
logfile=/code/logs/supervisord/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=0 ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/code/supervisord/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=true ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
nocleanup=false ; (don't clean up tempfiles at start;default false)

[program:gunicorn]
startsecs = 2
autorestart = true
command=gunicorn -c gunicorn.conf.py wolfeye.wsgi:application

3. Fire the rocket

supervisord -c supervisord.conf

4. Watch the logs

tail -F /code/logs/supervisord/supervisord.log

EOF
Enjoy
I, simon love this world ❤️