需要があるかは不明(多分ない)
いちいちコマンド打つのが大変だった
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