PythonApp A starts PythonApp B on a remote server and terminates if the B has been successfully started.
The following command works fine, there is no problem.
cmd = "ssh -o GSSAPIAuthentication=no -o ForwardX11=no myuser@myserver nohup python3 -m secondapp -vv < /dev/null 2> /dev/null > /dev/null &"
subprocess.Popen(cmd)
However, if for instance passwordless ssh is not setup, the B will not start properly.
What are alternative ways to start B and to terminate A only once it has been verified B is running.