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-varnish
100755 23 lines (18 sloc) 0.508 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh -e
 
SERVICE_DIR=$(dirname $0)/service
PORT=$1
HAPROXY_PORT=$2
 
if [ -z "$PORT" ]; then
echo "usage: $0 port_number haproxy_port" >&2
  exit 2
fi
 
NEW_SERVICE_DIR="$SERVICE_DIR/varnish-$PORT-$HAPROXY_PORT"
 
if [ ! -e "$NEW_SERVICE_DIR" ]; then
mkdir -p "$NEW_SERVICE_DIR"
  ln -s ../../varnish-run $NEW_SERVICE_DIR/run
  ln -s ../../check-port $NEW_SERVICE_DIR/check
  echo "created varnish service $NEW_SERVICE_DIR"
else
echo "varnish service $NEW_SERVICE_DIR already exists" >&2
  exit 1
fi