Sending Signal to remote process

Randall S. Becker rsbecker at nexbridge.com
Wed Jan 24 01:25:50 AEDT 2018


On January 23, 2018 6:13 AM, Thomas Güttler wrote:
> 
> I want ssh to forward the SIGTERM signal to the remote command.
> 
> 
> Example:
>     ssh root at localhost /root/print-signal.py
> 
> 
> Get PID of ssh:
>      ps aux| grep print-signal
> 
> 
> Kill the matching ssh process:
>      kill pid-of-ssh
> 
> 
> Unfortunately only the ssh process itself gets the signal, not the remote
> command (print-signal.py). The remote command does not terminate :-(
> 
> How can I make ssh "forward" the SIGTERM signal to the remote command?
> 
> See https://stackoverflow.com/questions/48377993/forwards-sigterm-over-
> ssh
> 
> According to this[1] answer, openssh does not implement this.
> 
> It would be realy great if openssh could forward the signal to the remote-
> command.
> 
> What do you think?

Would you consider using a separate SSH session to get to the lower level process, along the lines of 

     ssh root at localhost 'kill -signum pid-of-py'

Or is this not the use case you're looking for.

Cheers,
Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.





More information about the openssh-unix-dev mailing list