These steps will guarantee that the listener is always running and it will start when the OS boots. They have been tested using Ubuntu 12.04, but these steps should work with any OS that uses upstart. We are assuming you are using rvm
mkdir ~/.gorgon && cd ~/.gorgon
rvm use ruby-1.9.3
or whatever version of ruby you use.gem install gorgon foreman
- Place your gorgon_listener.json in this directory. See here for a gorgon_listener.json example.
echo 'listener: [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" &&
rvm ruby-1.9.3 do gorgon listen > listener.out 2> listener.err' > Procfile
rvmsudo foreman export upstart /etc/init -a gorgon -u `whoami` -c listener=1
sudo start gorgon
- open ’/etc/init/gorgon.conf’ and add
start on runlevel [2345]
at the top of the file - Check if listener is running: Run
tail /tmp/gorgon-remote.log
and the last line should say “Waiting for jobs…”
If you modify ~/.gorgon/gorgon_listener.json, make sure you restart the listener by running sudo restart gorgon