Skip to content

Instantly share code, notes, and snippets.

@denysonique
Created July 27, 2011 15:51
Show Gist options
  • Save denysonique/1109662 to your computer and use it in GitHub Desktop.
Save denysonique/1109662 to your computer and use it in GitHub Desktop.
filename=$(basename $0)
APP=${filename#thin-}
CONFIG="/etc/thin/$APP.yml"
ARGS="--daemonize --config=/etc/thin/$APP.yml"
RVM_ENV="ruby-1.8.7-p352@redmine"
source "/usr/local/rvm/environments/$RVM_ENV"
COMMAND="sudo -Eu $APP $(which thin)"
case "$1" in
start)
$COMMAND start $ARGS
;;
stop)
$COMMAND stop $ARGS
;;
restart)
$COMMAND restart $ARGS
;;
*)
echo "Usage: $0 {start|stop|restart}" >&2
exit 3
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment