Subprocess terminating when Python exits when using disown in i3
<p>I currently have the following setup:</p>

<p>in i3 config:</p>

<pre><code>bindsym $mod+d exec xfce4-terminal --title="Supermenu" -e "path/to/supermenu"
for_window [title="Supermenu"] floating enable
</code></pre>

<p>The script it executes is a Python script executable (using a shebang and chmod +x), that has this line (among a lot of others, which have nothing to do with it):</p>

<pre><code>os.system(command + " &gt;/dev/null 2&gt;&amp;1 &amp;")
</code></pre>

<p>My expectation, is that when the Python script exits, the process called by <code>command</code> should stay running, because of the <code>&amp;</code>. However, it still exits once the xfce4-terminal exits! (which happens after the script terminates obviously).</p>

<p>I also tried sticking <code>disown</code> at the end and <code>nohup</code> at the beginning, both made no difference.</p>

<p>I can confirm it happens when the script exits, because I tried using <code>time.sleep</code> to see if it even launches, and yes it does - but terminates after the terminal closes.</p>

<p><strong>However, if I launch <code>firefox</code> or <code>ghetto-skype</code>, they do terminate, however, an <code>xfce4-terminal</code> does not terminate after the "menu" closes!</strong></p>

<p><strong>And even weird - if I launch the script from an xfce4-terminal (instead of with i3), the subprocess will not terminate either!</strong></p>

<p>I am very confused as to what is going on, and would appreciate any help with understanding it, and prevent the processes other than <code>xfce4-terminal</code> from closing after the menu does.</p>

<p>You aren't redirecting standard input.  I'm guessing it gets an EOF when <code>xfce4-terminal</code> closes.</p>

python linux process