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 !
rails-runit / add-haproxy
100755 22 lines (17 sloc) 0.462 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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/haproxy-$PORT"
 
if [ ! -e "$NEW_SERVICE_DIR" ]; then
mkdir -p "$NEW_SERVICE_DIR"
  ln -s ../../haproxy-run $NEW_SERVICE_DIR/run
  ln -s ../../check-port $NEW_SERVICE_DIR/check
  echo "created haproxy service $NEW_SERVICE_DIR"
else
echo "thin service $NEW_SERVICE_DIR already exists" >&2
  exit 1
fi