running a python script in the background

Arun Sivakumaran arun.sivakumaran at gmail.com
Sat Oct 30 04:42:02 EDT 2004


Actually, I am working from a 32-bit linux client and am SSHing to a
64-bit itanium server (not sure what's being run there).

I had tried the nohup option too before, that doesn't seem to help.

Thanks,
Arun


On Fri, 29 Oct 2004 23:08:25 -0700, Josiah Carlson <jcarlson at uci.edu> wrote:
> 
> arun.sivakumaran at gmail.com (Arun) wrote:
> > the simulations totally in the background (the simulations run for a
> > day or two, so basically I want to start them in background and log
> > off).
> 
> > Now if I start the script in the background with "script.py &", it
> > doesn't work. I figure the reason is the system() call spawns the
> > simulator in the foreground.
> 
> > Is there a way I can make this all run in the background, while at the
> > same time ensuring that only one instance of the simulator is running?
> 
> It sounds like you are running this on *nix.  The Python interpreter is
> likely dying when you log-off due to a 'hangup' signal being called when
> you log out.
> 
> What has worked for me in the past is to SSH to localhost, executing:
> "nohup python script.py &" and disconnecting.  It should work running
> from a local terminal (without SSH), but I can't guarantee it.
> 
>  - Josiah
> 
> 


-- 
-AP
Arun.Sivakumaran at gmail.com
(720)-771-7543



More information about the Python-list mailing list