[Twisted-Python] sending signal through SSHChannel
paulswartz at gmail.com
Fri Oct 24 13:32:26 EDT 2008
On Tue, Sep 30, 2008 at 12:06 PM, Frans Mårtensson
<frans.martensson at gmail.com> wrote:
> I have written a python program that executes shell scripts on remote
> computers using the twisted conch SSHChannel. Several shell scripts
> are executed at once on several machines and the scripts range in
> execution time from minutes to hours.
> My question is regarding the behavior of Conch when it is shut down.
> What i would like to do is to send a SIGINT or SIGKILL to the remote
> script so that it can terminate in an orderly fashion. I am using the
> channel.SSHChannel as a base class for my task. Is there a mechanism
> in Conch for sending this signal?
There's a mechanism for sending signals in SSH, although Conch doesn't
expose it directly. The code looks something like this:
channel.conn.sendRequest(channel, 'signal', NS('KILL'))
For more information on what kinds of signal names you can send and on
the 'signal' request generally, you should read RFC4254 section 6.9
paulswartz at gmail dot com
More information about the Twisted-Python