This is rather about using supervisorctl
than using fabric
Avoid fab calls to commands, requiring user interaction
Fabric does one-shot calls to commands and then returns. Shall be no long term activity on console. The solution for your problem is not to enter interactive mode (which awaits some further input), but call supervisor
only in non-interactive mode.
Calling supervisorctl
in non-interactive mode
Supervisor control command provides interactive and non-interactive mode.
You non-interacive mode.
E.g. in my installation, I have a service called logproxy
Calling supervisorctl
in this way:
$ supervisorctl status logproxy
logproxy STOPPED Not started
Applying this to your fab task shall make it working.
Following the sample code from "Welcome to Fabric!" it would look like:
from fabric.api import run
def super_status():
uname = "zen"
pswd = "then"
cmd = "supervisorctl -u {uname} -p {pswd} status logproxy".format(uname=uname, pswd=pswd)
# to see the command you are going to call, just for show
print cmd
# and run it
run(cmd)
And would be used.
$ fab -l
to list it.
and calling the task super_status
:
$ fab super_status -H localhost