I have written a script that I am using to push and deploy a new service to several machines under my control, and in order to execute the process I am using ssh to remotely start the process. Unfortunately, whenever I use SSH to start the process, the SSH command never seems to return, causing the script to stall.
The command is specified as: ssh $user@$host "/root/command &". Whenever I run simple commands, such as ps or who, the SSH command returns immediately, however when I try and start my process it does not return. I have tried tricks like wrapping my process in a simple bash script that starts the process and then exits, however this also hangs the SSH command (even if the bash script echos a success message, and exits normally).
Does anyone have any insight into what is causing this behaviour, and how I can get the SSH command to return as soon as the process has been started?
Thanks for your insights!