Autostart resque for Gitlab on CentOS 6.2 with RVM installed

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
Share this Diese Icons verlinken auf Bookmark Dienste bei denen Nutzer neue Inhalte finden und mit anderen teilen können.
  • MisterWong
  • del.icio.us
  • Google Bookmarks
  • Facebook
  • TwitThis
  • DZone
  • Digg
  • Print

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert