public
Description: Run rails applications reliably as runit services
Homepage: http://www.sanityinc.com/
Clone URL: git://github.com/purcell/rails-runit.git
Click here to lend your support to: rails-runit and make a donation at www.pledgie.com !
purcell (author)
Tue Oct 21 08:00:17 -0700 2008
commit  0a0574882c3c7dc1020f215bf3e65a79ce413c3b
tree    ea251ee288b5c1f52bafe75359450eec59d01e7c
parent  06832d0fcc42af751c7336515deb39463a78e9d5
rails-runit / mongrel-run
100755 24 lines (18 sloc) 0.477 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh -e
 
PORT=$(basename $(pwd)|awk -F- '{print $2}')
BASE=$(dirname $(readlink $0))
APP_DIR=$BASE/app
 
if [ -e $BASE/mongrel_rails ]; then
MONGREL_RAILS=$BASE/mongrel_rails
else
MONGREL_RAILS=mongrel_rails
fi
 
if [ -z "$PORT" ]; then
echo "usage: $0 port" 1>&2;
  exit 2
fi
 
if [ ! -d "$APP_DIR" ]; then
echo "no such app dir: $APP_DIR (did you create a symlink to your Rails app?)" 1>&2;
  exit 2
fi
 
exec $MONGREL_RAILS start -e production -p $PORT -c $APP_DIR