How to send SIGINT to a remote process over SSH?

前端 未结 4 755
北海茫月
北海茫月 2020-12-09 17:41

I have a program running on a remote machine which expects to receive SIGINT from the parent. That program needs to receive that signal to function correctly. Unfortunately,

相关标签:
4条回答
  • 2020-12-09 18:17
    $ ssh -t foo.bar.com gdb
    ...
    (gdb) ^C
    Quit
    
    0 讨论(0)
  • 2020-12-09 18:23

    Can you run a terminal on the remote machine and use kill -INT to send it the signal?

    0 讨论(0)
  • 2020-12-09 18:35

    Try signal SIGINT at the gdb prompt.

    0 讨论(0)
  • 2020-12-09 18:37

    It looks like you're doing ctrl+c. The problem is that your terminal window is sending SIGINT to the ssh process running locally, not to the process on the remote system.

    You'll have to specify a signal manually using the kill command or system call on the remote system.

    or more conveniently using killall

    $killall -INT gdb
    
    0 讨论(0)
提交回复
热议问题