1

I am looking for some ideas on how to start up my "Thin" Rails server automatically, whenever the machine where it resides reboots.

The problem is that when the machine reboots, "Thin" needs to be started up manually, which causes issues with the Rails sites being down until someone starts up "Thin" by hand.

/var/www/app_directory# thin start --ssl -e production

Details
Ruby: 1.9.2
Rails: v3.2.1
Thin: v1.5.0
Machine: Debian 6 "Squeeze"

I know that apache runs as it's own user on the box. Not sure if that same approach makes sense with my particular problem.

Thanks

1 Answer 1

1

I used the instructions here: http://jordanhollinger.com/2011/04/22/how-to-use-thin-effectivly

to create a configuration file and start thin as a normal service at server boot. To get started, one would run:

thin install

It should set up a start up file in hopefully the proper directory, and tell you where it is. For me, in CentOS/Fedora I had to move the thin file from /etc/rc.d to /etc/rc.d/init.d

You then add it to chkconfig, or similar facility in your system, and turn it on for the right run levels (3,4,5). I did:

chkconfig --add thin
chkconfig --level 345 thin on
chkconfig --level 2 thin off

And you can start or restart thin with:

service thin start
service thin restart
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .