LoginSignup
2
0

More than 5 years have passed since last update.

unicornとNginxをリロード&リスタートするシェルスクリプト

Last updated at Posted at 2016-08-16

需要があるかは不明(多分ない)
いちいちコマンド打つのが大変だった

allrestart.sh
#!/bin/sh

echo "allrestart.sh START"

#unicorn
ps -ef | grep unicorn | grep -v grep

kill -QUIT `cat tmp/unicorn.pid`

echo "unicorn停止中......"
sleep 5;

#unicorn-start
bundle exec unicorn_rails -c config/unicorn.rb -E production -D


#nginx
sudo service nginx reload
sudo service nginx restart


echo "--------------------------------------------------"

echo "NOW STATUS"

ps -ef | grep unicorn | grep -v grep

sudo service nginx status

echo "--------------------------------------------------"

echo "allrestart.sh FINISH"

アプリがあるディレクトリに作っといて

$ sh allrestart.sh
2
0
1

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