am trying to start a celerycam process using fabric using the below nohup command. Unfortunately, nothing is happening, manually using the same command i could start the pro
I was able to circumvent this issue by running nohup ... &
over ssh
in a separate local shell script. In fabfile.py
:
@task
def startup():
local('./do-stuff-in-background.sh {0}'.format(env.host))
and in do-stuff-in-background.sh
:
#!/bin/sh
set -e
set -o nounset
HOST=$1
ssh $HOST -T << HERE
nohup df -h 1>>~/df.log 2>>~/df.err &
HERE
Of course, you could also pass in the command and standard output / error log files as arguments to make this script more generally useful.
(In my case, I didn't have admin rights to install dtach
, and neither screen -d -m
nor pty=False
/ sleep 1
worked properly for me. YMMV, especially as I have no idea why this works...)