title: How can I use Ubuntu's service command to manage Ring apps?
body: <p>I’m using a Ubuntu VPS to host a couple of Ring web apps. I have a separate GNU Screen window for each one, and I start and stop them using <code>lein run</code> and <code>^C</code>, respectively. This works, but it feels amateurish and if anything goes wrong these services won’t be restarted automatically.</p>
  
  <p>I’d like to set something up so that I can start and stop my apps using Ubuntu’s <code>service</code> command (which I already use to start and stop nginx). Is there some kind of shortcut I can use to get these apps working with the <code>service</code> command? For example, is there some Leiningen- or Ring-friendly template into which I can just insert my application’s path? Failing that, what would be the best practices for writing my own <code>service</code> script to integrate with Jetty?</p>