Skip to content

Commit

Permalink
Merge pull request #7 from longnguyen11288/master
Browse files Browse the repository at this point in the history
Added support to thin to have specify number of thin workers
  • Loading branch information
mpapis committed Mar 21, 2012
2 parents 77cc519 + 6d6172b commit 8536360
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 26 deletions.
11 changes: 2 additions & 9 deletions thin/bin/restart
@@ -1,18 +1,11 @@
#!/bin/sh

if user is root
then
log error "Thin ${action} may be run only as a non-root user."
fi

source "$HOME/.env" # This file should load the ruby environment & define 'port'

exec thin restart \
--address 0.0.0.0 \
--environment ${environment} \
--chdir "$HOME/active/${project}" \
--log "$HOME/shared/log/${environment}.log" \
--tag ${project}:${environment} \
--port ${port} -s2 \
--pid /var/run/${project}/thin.pid
--port ${port} -s${thin_worker} \
--pid "$HOME/shared/pids/${project}.pid"

9 changes: 1 addition & 8 deletions thin/bin/start
@@ -1,18 +1,11 @@
#!/bin/sh

if user is root
then
log error "Thin ${action} may be run only as a non-root user."
fi

source "$HOME/.env" # This file should load the ruby environment & define 'port'

exec thin start \
--address 0.0.0.0 \
--environment ${environment} \
--chdir "$HOME/active/${project}" \
--log "$HOME/shared/log/${environment}.log" \
--tag ${project}:${environment} \
--port ${port} -s2 \
--port ${port} -s${thin_worker} \
--pid "$HOME/shared/pids/${project}.pid"

11 changes: 2 additions & 9 deletions thin/bin/stop
@@ -1,18 +1,11 @@
#!/bin/sh

if user is root
then
log error "Thin ${action} may be run only as a non-root user."
fi

source "$HOME/.env" # This file should load the ruby environment & define 'port'

exec thin stop \
--address 0.0.0.0 \
--environment ${environment} \
--chdir "$HOME/active/${project}" \
--log "$HOME/shared/log/${environment}.log" \
--tag ${project}:${environment} \
--port ${port} -s2 \
--pid /var/run/${project}/thin.pid
--port ${port} -s${thin_worker} \
--pid "$HOME/shared/pids/${project}.pid"

1 change: 1 addition & 0 deletions thin/shell/includes
@@ -1 +1,2 @@
api/user
api/variables
13 changes: 13 additions & 0 deletions thin/shell/initialize
@@ -0,0 +1,13 @@
#!/bin/sh

if user is root
then
log error "Thin ${action} may be run only as a non-root user."
fi

if variable is empty thin_worker
then
export thin_worker=2
fi

source "$HOME/.env" # This file should load the ruby environment & define 'port'

0 comments on commit 8536360

Please sign in to comment.