Permalink
Browse files

Initial revision

  • Loading branch information...
0 parents commit 07476cc6754740e9a52f88c73a55bdb0663785f9 @purcell committed Dec 16, 2007
Showing with 51 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +20 −0 add-mongrel
  3. +28 −0 mongrel-run
  4. +1 −0 service/.gitignore
@@ -0,0 +1,2 @@
+mongrel_rails
+app
@@ -0,0 +1,20 @@
+#!/bin/sh -e
+
+SERVICE_DIR=$(dirname $0)/service
+PORT=$1
+
+if [ -z "$PORT" ]; then
+ echo "usage: $0 port_number" >&2
+ exit 2
+fi
+
+NEW_SERVICE_DIR="$SERVICE_DIR/mongrel-$PORT"
+
+if [ ! -e "$NEW_SERVICE_DIR" ]; then
+ mkdir -p "$NEW_SERVICE_DIR"
+ ln -s ../../mongrel-run $NEW_SERVICE_DIR/run
+ echo "created mongrel service $NEW_SERVICE_DIR"
+else
+ echo "mongrel service $NEW_SERVICE_DIR already exists" >&2
+ exit 1
+fi
@@ -0,0 +1,28 @@
+#!/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
+
+if [ ! -e "$MONGREL_RAILS" ]; then
+ echo "could not find mongrel_rails" 1>&2;
+ exit 2
+fi
+
+exec $MONGREL_RAILS start -e production -p $PORT -c $APP_DIR
@@ -0,0 +1 @@
+*

0 comments on commit 07476cc

Please sign in to comment.