fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Can't figure out how to spawn process with local


From: Jeff Forcier
Subject: Re: [Fab-user] Can't figure out how to spawn process with local
Date: Fri, 18 Sep 2009 21:17:10 -0400

Hi Taras,

Using '&' isn't really daemonizing -- it's simply putting the process
into the background of the invoking shell session. This is why local()
never returns: because the shell it creates is still waiting for the
process to finish.

Instead, you may want to try using 'nohup' or 'screen', which IIRC can
truly detach from the spawning shell, and will then return control to
you.

Also note that local() is simply a wrapper around the 'subprocess'
module (albeit one that honors Fabric's context managers like cd()) so
you can always use subprocess directly, or other Python modules
dealing with processes, such as 'multiprocessing' or 'os'.

Best,
Jeff

On Fri, Sep 18, 2009 at 7:11 PM, Taras Mankovski <address@hidden> wrote:
> Hey Guys,
> I'm trying to start google app engine's dev_runserver as a daemon.
> So I'm trying to do
> pid = local('./bin/dev_appserver --port=%s beecoop.com & '%(env.port))
> But when it gets to this line, it just sits there and waits.
> If I run this command in bash I get
> ./bin/dev_appserver --port=10500 beecoop.com &
> [1] 17095
> Can you please explain why it does this? and what how would I get it
> daemonize and move on?
> Thank you,
> Taras
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]