Python Paramiko Child Process
<p>I've written  a script that uses PARAMIKO library to log on to a server and executes a command. This command actually invokes the server to execute another python script (resulting in a child process I believe). I believe the server returns back signal indicating that the command was executed successfully, however it doesn't seem to wait for the new child process to complete - only that the original parent process has been completed. Is there anyway of waiting to reference any/all child processes that were generated as a result of this command and waiting that they are all completed before returning control to the initiating client?</p>

<p>Many thanks.</p>

<p>Without the code this will be difficult. I think you should create a rest service . So you would POST to <a href="http://0.0.0.0/runCode" rel="nofollow">http://0.0.0.0/runCode</a> and this would kick off a process in a different thread. That would end that call. The thread is still running ...when done do a post to http:// 0.0.0.0/afterProcessIsDone this will be the response from the thread that was kicked off. Then in that route you can do whatever you want with thay response there. If you need help with REST check out Flask.  It's pretty easy and straight to the point for small projects.</p>

python shell process subprocess paramiko