Ășlfurinn

thin 'init.d' with individual server support

I’m using thin for several apps on my server, and the default init.d script only knows how to restart all of them at once, which obviously can sometimes be too drastic, so I hacked up a gentler version:

service thin start|stop|restart [server]

Omitting the server keeps the old behaviour.

It will use bundle exec if it finds a Gemfile in the webapp’s root directory.

The script sets and exports HOME because Debian’s service strips it away but bundler needs it to find gems installed from git in lieu of vendor, if you happen to not be using it.

gist