title: Does linux kill background processes if we close the terminal from which it has started?
body: <p>I have an embedded system, on which I do <code>telnet</code> and then I run an application in background:</p>
  
  <pre><code>./app_name &amp;
  </code></pre>
  
  <p>Now if I close my terminal and do <code>telnet</code> from other terminal and if I check then I can see this process is still running.</p>
  
  <p>To check this I have written a small program:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include&lt;stdio.h&gt;
  main()
  {
      while(1);
  }
  </code></pre>
  
  <p>I ran this program in my local linux pc in background and I closed the terminal.</p>
  
  <p>Now, when I checked for this process from other terminal then I found that this process was also killed.</p>
  
  <p>My question is:</p>
  
  <ul>
  <li>Why undefined behavior for same type of process?</li>
  <li>On which it is dependent?</li>
  <li>Is it dependent on version of Linux?</li>
  </ul>