1

I have a iOS archive job on a mac slave which will take a long time sometimes 30min The question is the ssh long connection often disconnect and caused the task fail.

Now I want to ask how can I do to avoid this question? What I'm looking for is when the long connection disconnect but the task continue to perform. How can I do?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
HarrisHan
  • 164
  • 2
  • 13

1 Answers1

1

Adding a keepAlive option is a feature request since 2014

As proposed workarounds, this ticket includes:

  1. Change the /etc/ssh/ssh_config by appending the following line to the end of this file. This tells the ssh client to send nop command periodically to avoid the ssh connection being disconnected.
    The unit of 80 is seconds. You may tune this parameter based on your network condition.
ServerAliveInterval 80
  1. In the Jenkins slave configuration page, change the Launch method to "Launch slave via execution of command on the Master". See the Jenkins built-in help for more details.

So far, I haven't see any issues in this configuration. Hope this helps.

See also "Remoting issues / SSH slaves".

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thx Vonc now I'm using `launch agent via excution of command on the master`now My jenkins runing on a docker container, the master is Linux,Now the question is it can't display the emoji & ruby encode url return the error result, early connect via ssh is good,Do you know how can I fix this? – HarrisHan Jun 10 '18 at 13:35
  • [here is the full description of my question](https://stackoverflow.com/questions/50784346/jenkins-launch-agent-via-excution-of-command-on-the-master-linux-cant-display-e) – HarrisHan Jun 10 '18 at 13:54