I am facing a problem regarding SSH, which exits when I don't want it to. My goal is to run multiple script (which are tests) and evaluate their exit value to detect errors on my project.
First, I will describe the process :
I have a local machine on which I run a script which call the following command :
ssh -t -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -i $PRIVATE_KEY $REMOTE_USER@$REMOTE_IP "cd ~/path/to/scripts && "$CMD
CMDis the script to run on the remote machine
On the remote machine, the "primary" script calls multiple "secondary" bash and python scripts.
And here is my problem : when one of the "secondary" python script called on the remote by the "primary" script exits with a value different from
0, it terminates the ssh connection without coming back to the "primary" script.
What can I do to prevent my SSH connection to terminates on an error of a "secondary" script ? I need my primary script to run until the end.