Created
July 27, 2011 15:51
-
-
Save denysonique/1109662 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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