- Enabled service for supervisor
- in my situation i enable supervisor services on runcloud
- Then Login in terminal server
- Go to supervisor.d
cd /etc/supervisor.d - Then vim a file name u want to add
- in my situation i add ci-worker.conf
/etc/supervisor.d $ vim ci-worker.conf
- in my situation i add ci-worker.conf
- Then add this code into your file
[program:ci-worker]
command=php /home/example/webapps/app-example/index.php worker process_example_queue
autostart=true
autorestart=true
stderr_logfile=/var/log/ci-worker.err.log stdout_logfile=/var/log/ci-worker.out.log- for
/home/example/webapps/app-example/index.phpis your web application path - for
workeris your controller name - for
process_example_queueis your function in controller to be excute stderr_logfile&stdout_logfileis generated log for monitoring. U can specify path for log file to be generated
- for
- After finish add file for worker can run both script
sudo supervisorctl rereadsudo supervisorctl update
- Then u can run to restart worker process
sudo supervisorctl restart ci-worker
Notes
- For check all status for worker u can run
sudo supervisorctl status
- If u make changes in worker file changes not be effected immediately u need to restart your worker like step no 8.
