¡Esta es una revisión vieja del documento!
sudo apt-get install supervisor
In path /etc/supervisor/supervisord.conf we can configure it for any user:
[unix_http_server] ;file=/var/run/supervisor.sock ; (the path to the socket file) file=/tmp/supervisor.sock ; (the path to the socket file) chmod=0777 ; sockef file mode (default 0700)
$ service supervisor stop $ service supervisor start
Add a configuration file in /etc/supervisor/conf.d with a content similar to:
[program:cat] command=/bin/cat process_name=%(program_name)s numprocs=1 directory=/tmp umask=022 priority=999 autostart=true autorestart=true startsecs=10 startretries=3 exitcodes=0,2 stopsignal=TERM stopwaitsecs=10 user=chrism redirect_stderr=false stdout_logfile=/a/path stdout_logfile_maxbytes=1MB stdout_logfile_backups=10 stdout_capture_maxbytes=1MB stderr_logfile=/a/path stderr_logfile_maxbytes=1MB stderr_logfile_backups=10 stderr_capture_maxbytes=1MB environment=A="1",B="2" serverurl=AUTO
$ supervisorctl reread $ supervisorctl update