Unicornのoldプロセスを削除する。 ※自分用メモ


Unicornのoldプロセスを削除する。

unicornを停止する

vagrant@vagrant-ubuntu-trusty:~/hoge_app$ bundle exec cap production unicorn:stop

[ec2-user@ip-12345 current]$ ls
app Capfile db Gemfile.lock public REVISION vendor
assets_manifest_backup config [email protected] lib Rakefile test
bin config.ru Gemfile log README.rdoc tmp
[ec2-user@ip-12345 current]$ ps aux | grep unicorn #このディレクトリでコマンドを実行する!!
ec2-user 12760 0.6 7.8 350136 80352 ? Sl 22:03 0:01 unicorn master -c /var/www/hoge_app/current/config/unicorn/production.rb -E deployment -D

ec2-user 12764 0.0 7.0 350136 71520 ? Sl 22:03 0:00 unicorn worker[0] -c /var/www/hoge_app/current/config/unicorn/production.rb -E deployment -D

ec2-user 12767 0.0 6.9 350136 70664 ? Sl 22:03 0:00 unicorn worker[1] -c /var/www/hoge_app/current/config/unicorn/production.rb -E deployment -D

ec2-user 17045 0.0 0.1 110456 1996 pts/1 S+ 22:07 0:00 grep --color=auto unicorn
[ec2-user@ip-12345 current]$ kill -s USR2 12760
[ec2-user@ip-12345 current]$ ps aux | grep unicorn
ec2-user 12760 0.6 7.8 350136 80352 ? Sl 22:03 0:01 unicorn master (old) -c /var/www/hoge_app/current/config/unicorn/production.rb -E deployment -D

ec2-user 12764 0.0 7.0 350136 71520 ? Sl 22:03 0:00 unicorn worker[0] -c /var/www/hoge_app/current/config/unicorn/production.rb -E deployment -D

ec2-user 12767 0.0 6.9 350136 70664 ? Sl 22:03 0:00 unicorn worker[1] -c /var/www/hoge_app/current/config/unicorn/production.rb -E deployment -D

ec2-user 17046 73.5 7.8 350252 80304 ? Sl 22:07 0:01 unicorn master -c /var/www/hoge_app/current/config/unicorn/production.rb -E deployment -D

ec2-user 17050 0.0 6.9 350252 70548 ? Sl 22:07 0:00 unicorn worker[0] -c /var/www/hoge_app/current/config/unicorn/production.rb -E deployment -D

ec2-user 17052 0.0 6.9 350252 70612 ? Sl 22:07 0:00 unicorn worker[1] -c /var/www/hoge_app/current/config/unicorn/production.rb -E deployment -D

ec2-user 17057 0.0 0.2 110456 2072 pts/1 S+ 22:07 0:00 grep --color=auto unicorn
[ec2-user@ip-12345 current]$ kill -s QUIT 12760