title: How do you make a ruby script start at boot?
body: <p>I've just written my one of my first ruby scripts. Its purpose is to run a command on a server whenever it gets called from <a href="https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/web_hooks/web_hooks.md" rel="nofollow">a git web hook</a>. </p>
  
  <pre><code>require 'webrick'
  
  server = WEBrick::HTTPServer.new(Port: ARGV.first)
  server.mount_proc '/' do |req, res|
    r10kstatus = system( "sudo r10k deploy environment -pv warn" )
    puts r10kstatus
  end
  
  trap 'INT' do server.shutdown end
  server.start
  </code></pre>
  
  <p>Now that I have a working script, how do I 'deploy' it. </p>
  
  <p>I need to: </p>
  
  <ul>
  <li>Easily place the script my servers with puppet</li>
  <li>Start this script automatically after a reboot</li>
  </ul>
  
  <p>I assume I could greate a gem, however how do I manage starting the script automatically? </p>
  
  <p>Options I'm looking into: </p>
  
  <p><a href="https://github.com/jordansissel/fpm" rel="nofollow">fpm</a><br>
  <a href="https://github.com/jordansissel/pleaserun" rel="nofollow">pleaserun</a><br>
  <a href="https://rubygems.org/" rel="nofollow">rubygems</a>  </p>
  
  <p><strong>Update</strong></p>
  
  <p>I've created a rubygem which I can deploy with puppet. </p>
  
  <pre><code>  package {'r10k_gitlab_webhook':
      ensure   =&gt; latest,
      provider =&gt; gem,
    }
  </code></pre>
  
  <p><a href="http://rubygems.org/gems/r10k_gitlab_webhook" rel="nofollow">http://rubygems.org/gems/r10k_gitlab_webhook</a></p>
  
  <p>I'm still not sure how to make it so this script is executed everytime the server is booted</p>