Skip to content

Instantly share code, notes, and snippets.

@nikushi
Last active December 17, 2015 03:49
Show Gist options
  • Select an option

  • Save nikushi/5545960 to your computer and use it in GitHub Desktop.

Select an option

Save nikushi/5545960 to your computer and use it in GitHub Desktop.
rvm環境のthinサーバをdaemontoolsで動かすためのrunスクリプト。thin startの行を変更すればthinに限らないです。softlimitは必要であれば。
#!/bin/sh
exec 2>&1
exec \
sh -c '
export HOME=/home/app/
export LANG=ja_JP.utf8
# @reference https://rvm.io/integration/cron/
source ~/.rvm/environments/ruby-2.0.0-p0@MyApp
cd ~/MyApp
exec \
setuidgid app \
softlimit -m 500000000 \
thin start -e production -p 10081
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment