Home
PHP
Tech Tube
MySQL
Linux
CSS&HTML
JavaScript

Supervisor settings and commands

Just basic supervisor settings commands and so on... Installation:
apt install supervisor
Location of the config files:
/etc/supervisor/conf.d/
Websockets supervisor:
[program:websocket-worker]
command=/usr/bin/php /var/www/groovesetter/artisan websockets:serve
numprocs=1
autostart=true
autorestart=true
user=root
stderr_logfile=/var/log/supervisor/websockets-worker.err.log
stdout_logfile=/var/log/supervisor/websockets-worker.out.log
8 Laravel queue workers:
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php /var/www/groovesetter/artisan queue:work sqs --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
numprocs=8
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stopwaitsecs=3600
Start the deamon:
supervisord
Restart a group of processes:
supervisorctl restart laravel-worker:*
Other useful commands:
supervisorctl status
supervisorctl reread
supervisorctl update
supervisorctl start websockets
supervisorctl stop websockets