Look at: https://github.com/wayneeseguin/rvm/blob/master/contrib/unicorn_init.sh http://rvm.io/integration/init-d
hmm, I had to miss the comments - the script got reworked since then