title: How to start a play2 application on a remote machine using capistrano
body: <p>I'm trying to deploy a play2 application with capistrano, but I can't figure out how to (re)start the play2 application after a successful deployment. Just triggering 'play start' will cause the process to be hanging waiting for me to press ctrl+D</p>
  
  <p>I've created a start script in the play app root folder </p>
  
  <pre><code>#!/bin/bash
  
  nohup bash -c "/var/lib/play2/play start &amp;&gt;&gt; /tmp/myapp.log 2&gt;&amp;1" &amp;&gt; /dev/null &amp;
  </code></pre>
  
  <p>It works great when I run this on the server. When I try to call this from my local machine over ssh it also works. But when I am using capistrano, it doesn't seem to do anything. My capistrano config looks like this:</p>
  
  <pre><code>namespace :deploy do
  
    task :restart do
      stop
      sleep 1
      start
    end
  
    task :start do
      run "cd #{current_release}/trip-api &amp;&amp; ./start.sh"
    end
  
    task :stop do
      run "cd #{current_release}/trip-api &amp;&amp; ./stop.sh"
    end
  end
  </code></pre>
  
  <p>What's the best way to start a play2 application on a remote machine? How to get it working with capistrano?</p>