In my previous blog post I described how to install Gitlab on a CentOS 6.2 machine. The Resque demon did not start automatically, so I thought I’ll create a little startup script for the resque.sh in the /var/www/gitlabhq directory, so it would autostart. As it turned out, it was harder than expected, because I use RVM. I assume, that you use the installation script I linked in my last blog post to install gitlab, otherwise the following steps could be different for you…. Here are the necessary steps to get it working:
1. Add the following to /etc/rc.local
/var/www/gitlabhq/resque.sh
2. Run the following command:
rvm wrapper ruby-1.9.2-p290 startup bundle
3. Modify the /var/www/gitlabhq/resque.sh
. The result should look like this:
cd /var/www/gitlabhq mkdir -p tmp/pids /usr/local/rvm/bin/startup_bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production PIDFILE=tmp/pids/resque_worker.pid BACKGROUND=yes