You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use spawn() within a spur shell. It creates a process on a remote machine as well as a child process (because of piped commands).
Then, when I want to kill the processes started (parent and child), I use: process.send_signal(signal.SIGTERM)
but it only terminates the parent process.
In the implementation of send_signal() in SshProcess, I believe that a '-' sign in front of the PID would allow to terminate the full process group i.e. parent and child. self._shell.run(["kill", "-{0}".format(signal), str(-self.pid)])
This change worked for me but I would like to hear the comments of one of the maintainers for spur.
Thanks
The text was updated successfully, but these errors were encountered:
For now, I am just calling directly a kill command to go around the default behaviour like you suggest.
But I think that spur would benefit from having the ability to kill a group of processes. Initially I was thinking about changing the behaviour of the send_signal() command but maybe an extra argument to that function would be better and provide the most flexibility:
I use
spawn()
within a spur shell. It creates a process on a remote machine as well as a child process (because of piped commands).Then, when I want to kill the processes started (parent and child), I use:
process.send_signal(signal.SIGTERM)
but it only terminates the parent process.
In the implementation of send_signal() in SshProcess, I believe that a '-' sign in front of the PID would allow to terminate the full process group i.e. parent and child.
self._shell.run(["kill", "-{0}".format(signal), str(-self.pid)])
This change worked for me but I would like to hear the comments of one of the maintainers for spur.
Thanks
The text was updated successfully, but these errors were encountered: