[Tutor] run in "deamon" mode?

Alan Gauld alan.gauld at btinternet.com
Thu Jan 10 09:10:05 CET 2008

"Allen Fowler" <allen.fowler at yahoo.com> wrote

> How can a make a python script run in "deamon mode"? (on a linux 
> box)

ISTR that there is a recipe for this on the ActiveState cookbook site?

> That is, I want to run the program via "python myfile.py"
> and have it drop me back to the command line.

Simply running in background achioeves this - add ampersand (&)
after the command.

> 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.

OK, That needs more work - although I think running it from
sudo would do the trick if thats an option. Otherwise its
the cookbook recipe I think.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list