Localで開発してるときに、Workerを停止したいと思う今日このごろなお年頃
前提
supervisord.d/worker.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work --daemon
numprocs=2
などなど...
こんな感じで作ってる
####停止
/var/www# supervisorctl
cron EXITED Xxx 00 00:00 PM
laravel-worker:laravel-worker_00 RUNNING pid 00000, uptime 00:00:00
laravel-worker:laravel-worker_01 RUNNING pid 00000, uptime 00:00:00
php-fpm RUNNING pid 00000, uptime 00:00:00
supervisor> stop laravel-worker:laravel-worker_00 # ← Workerを停止
laravel-worker:laravel-worker_00: stopped
supervisor> stop laravel-worker:laravel-worker_01 # ← Workerを停止
laravel-worker:laravel-worker_01: stopped
supervisor> status # ← ステータスを再取得して確認する
cron EXITED Xxx 00 00:00 PM
laravel-worker:laravel-worker_00 STOPPED Xxx 00 00:00 PM # 停止しているのを確認
laravel-worker:laravel-worker_01 STOPPED Xxx 00 00:00 PM # 停止しているのを確認
php-fpm RUNNING pid 00000, uptime 0:00:00
supervisor> exit # 抜ける
####再起動
/var/www# supervisorctl restart all
laravel-worker:laravel-worker_00: stopped
laravel-worker:laravel-worker_01: stopped
php-fpm: stopped
cron: started
laravel-worker:laravel-worker_00: started
laravel-worker:laravel-worker_01: started
php-fpm: started