title: Stop bash script from dying when exiting Java / Kotlin application
body: <p>I'm starting a bash script from Kotlin, but the bash script stops running as soon as the Kotlin application exits.</p>
  
  <pre><code>val pr = ProcessBuilder("/home/vlad/liq", script, input).start()
  </code></pre>
  
  <p>Where script is a liquidsoap script and input is a parameter that's being passed into the script</p>
  
  <p>Typically, it'll run something like the following:</p>
  
  <pre><code>./liq blah.liq http://somedomain.com:8090
  </code></pre>
  
  <p><code>liq</code> then executes a liquidsoap script which is the first param and the second param is then used as a param for the liquidsoap script.</p>
  
  <pre><code>#!/bin/bash
  
  nohup /usr/bin/liquidsoap $1 -- $2 &gt; /dev/null 2&gt;&amp;1 &amp;
  
  # this causes syntax error
  # nohup (/usr/bin/liquidsoap $1 -- $2 &gt; /dev/null 2&gt;&amp;1 &amp;)
  </code></pre>
  
  <p>This Kotlin application is run via <code>java -jar dashboard.jar</code>, while the application is running, that liquidsoap script is running, as soon as i exit the Kotlin application with Ctrl + C, that liquidsoap script also stops. </p>
  
  <p>I was under the impression that <code>nohup</code> + <code>&amp;</code> would spawn a new console thus keeping the script running even after the Kotlin application exits, but it's not.</p>
  
  <p>Any ideas on how to keep the script running even after my Kotlin application exits ?</p>