0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

docker worker 停止

Last updated at Posted at 2021-09-29

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?