summaryrefslogtreecommitdiffstats
path: root/config/deploy/templates/thinrc.erb
blob: 141170b5dc4706a0af3be54bf61cb66c9de3929e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

# PROVIDE: <%= fetch(:application) %>
# REQUIRE: LOGIN
# BEFORE: nginx

. /etc/rc.subr

name=<%= fetch(:application) %>
rcvar=`set_rcvar`

: ${<%= fetch(:application) %>_enable:="NO"}
: ${<%= fetch(:application) %>_root:="<%= fetch(:deploy_to) %>"}

load_rc_config $name

shared_dir="<%= fetch(:shared_dir) %>"
socket="$shared_dir/tmp/sockets/thin.sock"
pidfile="$shared_dir/tmp/pids/thin.pid"

command="<%= fetch(:current_dir) %>/bin/thin"
command_args="start -S $socket -P $pidfile -d --prefix=/registration"
command_interpreter="ruby22"

procname="thin"

<%= fetch(:application) %>_chdir="$<%= fetch(:current_dir) %>"
<%= fetch(:application) %>_user="www"
<%= fetch(:application) %>_env="RACK_ENV=production PATH=$PATH:/usr/local/bin"

run_rc_command "$1"