0

1.I am doing this on local machine

tmux new -s amazon 

then I ssh in to the server into tmux window

shh user@amazon

then I detach it ctrl b-d

Into fabfile.py I am doing like this

local("tmux a -t amazon") #attaching detached session
local("./myscript") #problem here the tmux session pops on django runserver 
#and waits for input

Problem : Tmux session pop up in Django dev server and doesnt run ./myscript line and waits forever. What I am doing wrong?

Note: ./myscript resides on remoteserver

  • Besides your current problem: Are you sure you want to open your `tmux` session on your local machine and doing `ssh` from this session? Doesn't make this the idea of "if the connection breaks, the script will continue to run" a bit pointless...? (Not sure if I get you right, if not, I'm sorry.) – gxx Jan 19 '16 at 09:57
  • My script is a starting another server listening on some port so its ok even if connection breaks. anyways thanks for your attention I found the solution. I am posting above – Yugandhar Chaudhari Jan 19 '16 at 10:03

1 Answers1

1

Solution is to keep the session detached and run commands via

 tmux send-keys -t <session-name> "Command ENTER"