Python Daemon dies
<p>I created a Daemon process with these lib<a href="https://www.python.org/dev/peps/pep-3143/" rel="nofollow">linktosite</a>
I connect trough ssh and start the process with python myDaemon.py start.</p>

<p>I use a loop within the daemon method to do my tasks. But as soon as I logout the daemon stops(dies).</p>

<p>Does this happen because I save the PID file on my user and not in the root folder?</p>

<p>Anyone a idea. I can deliver code but now on Thread creation.(+3h)</p>

<p>Use the shebang line in your <code>python</code> script. Make it executable using the command.
    chmod +x test.py
Use no hangup to run a program in background even if you close your terminal.</p>

<pre><code>nohup /path/to/test.py &amp;
</code></pre>

<p>Do not forget to use <code>&amp;</code> to put it in background.</p>

<p>To see the process again, use in terminal,</p>

<pre><code>ps ax | grep test.py
</code></pre>

<p><a href="http://askubuntu.com/questions/396654/how-to-run-the-python-program-in-the-background-in-ubuntu-machine">Answer</a></p>

<p><a href="http://stackoverflow.com/questions/4705564/python-script-as-linux-service-daemon?rq=1">Another way would be actually make it an upstart script</a></p>

python linux daemon