On Thu, Oct 15, 2009 at 2:25 PM, Kenneth Gonsalves <[email protected]> wrote: > hi, > > I need to run a python server on my remote box. At present I do: > > python myserver.py & > > my question is: If I log out from the server, will the script keep running? or > will it die as soon as I leave. Experiments on the laptop seem to indicate > that it will keep running even if I log out. > > I can also do > screen python myserver.py & <--- this will work even if I log out. How about > the first one. Or is there some other way (script in /etc/init.d/ for example > to do this elegantly?)
If you run a server you should daemonize it. What is necessary is to make it the session group leader of a different session. setsid() is also found in shells. If you want to run a command at a particular time once, you have the at(1) command. For servers, the preferred way is to daemonize either using perl or C. Since you are a python enthusiast I hope there is a way to do it in python as well. I am too ignorant to know. -Girish -- Gayatri Hitech web: http://gayatri-hitech.com SpamCheetah Spam filter: http://spam-cheetah.com _______________________________________________ To unsubscribe, email [email protected] with "unsubscribe <password> <address>" in the subject or body of the message. http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
