Skip to content

Instantly share code, notes, and snippets.

@wayneeseguin
Forked from anonymous/gist:444342
Created June 19, 2010 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wayneeseguin/444418 to your computer and use it in GitHub Desktop.
Save wayneeseguin/444418 to your computer and use it in GitHub Desktop.
#!/bin/bash
project_root="${project_root:-"/srv/cms/current/"}"
home_dir="${home_dir:-"/home/capdeploy"}"
rvm_path="${rvm_path:-"$home_dir/.rvm"}"
port="${1:-8000}"
environment="${2:-production}"
pids_path="${project_root}/tmp/pids/"
command="${3:-start}"
# It is important that we setup the RVM environment from .bashrc
# and/or using project .rvmrc in $project_root
. "$home_dir/.bashrc"
cd "${project_root}"
mkdir -p "$pids_path"
# Might also want ot think about explicitely setting the log path :)
exec thin --daemonize --environment ${environment} --port ${port} --pid $project_root/tmp/pids/thin.${port}.pid ${command}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment