Re: Sending Signal to remote process

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



Well, it would be nice to do

ssh remote print-signal.py

and then

ssh remote pkill print-signal.py

This should work for your way of
getting pid but beware when you
have two or more instances
that could be running and want
selective killing.

Instead a pkill calling and the use of pgrep
I like to write a pagre and peca like so

bin/pagre
#!/bin/bash
ps -A | grep $1

bin/peca
#!/bin/bash
pgrep $@ | cut -d" " -f2 | xargs kill -9

so you will have to do

ssh remote peca print-signal.py

cheers

carlos

El martes, 23 de enero de 2018, Thomas Güttler <guettliml@xxxxxxxxxxxxxxxxxx>
escribió:

> I want ssh to forward the SIGTERM signal to the remote command.
>
>
> Example:
>    ssh root@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?
>
> Regards,
>   Thomas Güttler
>
>
> [1] https://stackoverflow.com/questions/46333657/send-signals-to
> -remote-process-with-python/47581495#47581495
>
>
>
> --
> Thomas Guettler http://www.thomas-guettler.de/
> I am looking for feedback: https://github.com/guettli/pro
> gramming-guidelines
>
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev@xxxxxxxxxxx
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux