[Tutor] run in "deamon" mode?
aditya.n.lal at gmail.com
Thu Jan 10 09:29:20 CET 2008
On Jan 10, 2008 11:11 AM, Allen Fowler <allen.fowler at yahoo.com> wrote:
> How can a make a python script run in "deamon mode"? (on a linux box)
> 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.
> Is there a standard library module to help with this?
> -- Thank you
The simplest way to achieve this is as follows :
$ nohup python myfile.py &
Otherwise you need to become daemon from inside the program. fork(),
setsid(), etc. - the normal C language method for becoming a daemon..
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor