title: How to execute spark-shell from file with nohup?
body: <p>I have a scala script file that gets successfully executed via interactive spark-shell in a classic way: type spark-shell, paste script, wait till completion.</p>
  
  <p>I want to be capable to leave this thing working and exit ssh session, get back to results when I need. </p>
  
  <p>I tried this and it behaves strangely</p>
  
  <pre><code>spark-shell -i file.scala &gt;&gt; out.log 2&gt;&amp;1 &amp;
  </code></pre>
  
  <p>It prints only several lines of usual spark output to out.log and then reports that the process has ended. When I do 'ps aux | grep spark' I see there is spark running among processes.</p>
  
  <p>When I run this it behaves as expected, but I have to leave session open to have my results.</p>
  
  <pre><code>spark-shell -i file.scala
  </code></pre>
  
  <p>Is there a way to get spark-shell working with nohup properly?</p>
  
  <p>I know there is spark-submit working with jars but it feels less intuitive, for a simple test I have to asseble a jar and do maven magic.</p>