Skip to content

Commit

Permalink
fix sr (server restart) and sst (server stop) for Rails 2.3 where…
Browse files Browse the repository at this point in the history
… the pid is in tmp/pids/server.pid
  • Loading branch information
mislav committed Feb 18, 2009
1 parent 6fa5266 commit 588f6dd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions bash_aliases
Expand Up @@ -76,13 +76,26 @@ alias fri='fri -w 98'
#########
alias sc='script/console'
alias ss='script/server' # start up the beast; use "ss -d" to detach
alias sst='kill `cat tmp/pids/mongrel.pid`' # stop daemonized Mongrel
alias a='autotest -rails'

# stop daemonized Rails server
function sst() {
if [ -f tmp/pids/mongrel.pid ]; then
echo "Stopping Mongrel ..."
kill `cat tmp/pids/mongrel.pid`
elif [ -f tmp/pids/server.pid ]; then
echo "Stopping server ..."
kill `cat tmp/pids/server.pid`
fi
}

# restart Rails application
function sr() {
if [ -f tmp/pids/mongrel.pid ]; then
echo "Restarting Mongrel ..."
kill -USR2 `cat tmp/pids/mongrel.pid`
elif [ -f tmp/pids/server.pid ]; then
echo "Restarting server ..."
kill -USR2 `cat tmp/pids/server.pid`
else
echo "Restarting Passenger instances ..."
touch tmp/restart.txt
Expand Down

0 comments on commit 588f6dd

Please sign in to comment.