fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Single tasks, 2 servers


From: Jeff Forcier
Subject: Re: [Fab-user] Single tasks, 2 servers
Date: Fri, 13 Sep 2013 13:35:21 -0700

Hi Lorenzo,

Fabric isn't well set up for this sort of thing, and since it's also
not threadsafe, you can't use that technique either.

What is usually recommended here is to use remote backgrounders like
screen or tmux (or process managers like supervisor, upstart, runit,
etc). This allows you to tell the remote system to manage your
listener in the background, returning control to Fabric.

Then you would add another subtask or run() statement at the end of
your main task that connects to the listener again & turns the process
back off.

Best,
Jeff

On Fri, Sep 13, 2013 at 10:21 AM, Lorenzo Bivens <address@hidden> wrote:
> Hi,
>
> I need to run a task that involves running commands in two separate servers.
> The task is to open a listener on the fixed host and receive a stream of
> data from the list of servers.
>
> The idea I have is to do something like: (loose syntax ahead )
> @task
> def data_transfer():
> server_list = ls_servers()
>
> execute(start_listening, hosts=listener)
> execute(start_sending, hosts=server_list)
>
> Obviously the task is going to stop on the first execute statement until it
> is doneā€¦
> Is there a way to put it in the background and jump to the next execute
> statement?
>
> Thanks!
>
> --
> Lorenzo Bivens - Lucera DevOps Team
> cel: (646) 203 1754 | support: (855) 551-2708
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org



reply via email to

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