5

How does one ensure when I spawn a process on a remote machine using Python Paramiko, that the process will die when the connection does?

Specifically, the issue I'm having is I'll run wget or some other command using Paramiko, and it will hang. Unfortunately, when I kill the python script process directly, The process on the remote machine does not die. It just keeps running and I have another hanging process.

I have to kill the process directly because I'm trying to link it with a tool which can only kill processes directly.

I've heard that this can be done in SSH by making SSH a "Control Terminal". Is there anything in Paramiko that can do this, or just kill any processes on a remote machine after it spawned?

Thanks!

DrakeAnderson
  • 492
  • 4
  • 12
  • when you terminate the ssh connection, the remote command's stdin reaches EOF. Not all commands check for this condition and continue running in this case. I'm surprised however that this is a problem for wget (unless you are downloading large files). – Andre Holzner Nov 23 '11 at 15:06

0 Answers0