Created
October 12, 2011 02:49
-
-
Save wxianfeng/1280118 to your computer and use it in GitHub Desktop.
About thin
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
root@SNDA-192-168-2-15:~# thin install | |
>> Installing thin service at /etc/init.d/thin ... | |
mkdir -p /etc/init.d | |
writing /etc/init.d/thin | |
chmod +x /etc/init.d/thin | |
mkdir -p /etc/thin | |
To configure thin to start at system boot: | |
on RedHat like systems: | |
sudo /sbin/chkconfig --level 345 thin on | |
on Debian-like systems (Ubuntu): | |
sudo /usr/sbin/update-rc.d -f thin defaults | |
on Gentoo: | |
sudo rc-update add thin default | |
Then put your config files in /etc/thin | |
root@SNDA-192-168-2-15:~# sudo /usr/sbin/update-rc.d -f thin defaults | |
update-rc.d: warning: thin stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (S 0 1 6) | |
Adding system startup for /etc/init.d/thin ... | |
/etc/rc0.d/K20thin -> ../init.d/thin | |
/etc/rc1.d/K20thin -> ../init.d/thin | |
/etc/rc6.d/K20thin -> ../init.d/thin | |
/etc/rc2.d/S20thin -> ../init.d/thin | |
/etc/rc3.d/S20thin -> ../init.d/thin | |
/etc/rc4.d/S20thin -> ../init.d/thin | |
/etc/rc5.d/S20thin -> ../init.d/thin | |
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
#!/bin/sh | |
PROJECT_PATH=/usr/local/system/projects/entos_dev | |
THIN_CONFIG=/usr/local/system/thin/thin.yml | |
BUNDLE_BIN=/home/entos/.rvm/gems/ruby-1.9.2-p290/bin/bundle | |
cd $PROJECT_PATH | |
case $1 in | |
"start" ) | |
echo "start thin" | |
$BUNDLE_BIN exec thin start -C $THIN_CONFIG | |
;; | |
"stop" ) | |
echo "stop thin" | |
$BUNDLE_BIN exec thin stop -C $THIN_CONFIG | |
;; | |
"restart thin" ) | |
echo "restart thin" | |
$BUNDLE_BIN exec thin restart -C $THIN_CONFIG | |
;; | |
*) | |
echo "need start|stop|restart" | |
exit 1 | |
esac |
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
# generate thin config for Rails project | |
# more options,SEE | |
# thin -h | |
thin config -C /etc/thin/thin.yml -c /usr/local/system/www/wxianfeng_com/current -e production -p 3000 -d -O -s 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment