summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2016-09-17 14:25:15 +0200
committerHarald Eilertsen <haraldei@anduin.net>2016-09-17 14:25:15 +0200
commit653e7c74e41c97c1ba15682a7d6e41123dc4ac56 (patch)
treef7671d42ea6700746b853052f0361242d544c95c
parentce3979dc01ea1018abbb0ba8e5378998dab00ed2 (diff)
downloadnorsk-urskog-registrations-653e7c74e41c97c1ba15682a7d6e41123dc4ac56.tar.gz
norsk-urskog-registrations-653e7c74e41c97c1ba15682a7d6e41123dc4ac56.tar.bz2
norsk-urskog-registrations-653e7c74e41c97c1ba15682a7d6e41123dc4ac56.zip
Add template rc init script for freebsd.
-rw-r--r--config/deploy/templates/thinrc.erb31
1 files changed, 31 insertions, 0 deletions
diff --git a/config/deploy/templates/thinrc.erb b/config/deploy/templates/thinrc.erb
new file mode 100644
index 0000000..141170b
--- /dev/null
+++ b/config/deploy/templates/thinrc.erb
@@ -0,0 +1,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"