<br><br><div class="gmail_quote">On Jan 10, 2008 11:11 AM, Allen Fowler <<a href="mailto:allen.fowler@yahoo.com">allen.fowler@yahoo.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br><br>How can a make a python script run in "deamon mode"? (on a linux box)<br><br>That is, I want to run the program via "python myfile.py" and have it drop me back to the command line. The program should continue running until I kill it via it's PID, the machine shuts down, or the program itself decides to shutdown. It should _not_ die when I simply log-out, etc.
<br><br>Is there a standard library module to help with this?<br><br>-- Thank you<br><div class="WgoR0d"><br><br><br></div></blockquote></div><div><br class="webkit-block-placeholder"></div><div>The simplest way to achieve this is as follows :
</div>$ nohup python myfile.py &<div><br class="webkit-block-placeholder"></div><div>Otherwise you need to become daemon from inside the program. fork(), setsid(), etc. - the normal C language method for becoming a daemon..
</div><div><br>-- <br>Aditya
</div>