running a script like a daemon

Alex Martelli aleaxit at yahoo.com
Sat Nov 8 18:14:44 CET 2003


ivan le magnifique wrote:

> I would like to know how to launch a script from the command line (like
> via telnet) with the ability to exit the command line without stopping the
> thead.
> Afterwards I would like to be able to retrieve the id of the thread to
> kill it.
> I know this is not really Python related since I have had the problem with
> Java already ( before my conversion to Python)... but, any idea would be
> appreciated.

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012

To write the daemon's pid to a suitable file (you wrote thread, but that
makes no sense -- I assume you mean process...?!), see os.getpid.


Alex





More information about the Python-list mailing list