Hi Paul,

I believe this falls under a Fabric-level FAQ:


http://www.fabfile.org/faq.html#why-can-t-i-run-programs-in-the-background-with-it-makes-fabric-hang

The tl;dr is that anything you could use for "ssh -t targethost 'command
line here'" which would result in that `ssh` command returning right away,
should also work for getting your run() call to return immediately. Some
examples are listed in the FAQ, though it's far from exhaustive.

In my own experience, screen or tmux represent the best combination of
availability & ease of use.

Best,
Jeff

On Mon, Apr 22, 2019 at 2:24 PM Paul Hoffman <[email protected]> wrote:

> Greetings. I use fabric in a testbed that launches commands on a
> particular remote computer. It works fine for
>    c.run("/path/to/command")
> when the command is a regular command like "hostname" or when it is a
> daemon that launches itself in the background.
>
> But I now need to launch what is in essence a command-line program *even
> though I don't need to interact with the command line*. I will later kill
> that command using other stuff that works fine with daemons. For example
> (this is not what I really need to do):
>    c.run("/usr/bin/ftp")
> In this case, "run" never returns, which of course stops the outer Python
> program.
>
> Is there a way in Fabric to say "launch this program and return
> immediately"? I am not seeing it in the invoke.runners.Runner doc, but I
> could be missing it.
>
> _______________________________________________
> Fab-user mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/fab-user
>


-- 
Jeff Forcier
Unix sysadmin; Python engineer
http://bitprophet.org
_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to