Starting a process over ssh using bash and then killing it on sigint

前端 未结 5 661

I want to start a couple of jobs on different machines using ssh. If the user then interrupts the main script I want to shut down all the jobs gracefully.

Here is a shor

5条回答
  •  北恋
    北恋 (楼主)
    2021-02-02 15:55

    Try this:

    ssh -tt host command 

    When you kill the local ssh process, the remote pty will close and SIGHUP will be sent to the remote process.

提交回复
热议问题