7

I've been having this problem for a while. Vagrant boxes abort at the end of a Jenkins job. I've limited the job to just a script with

vagrant up
sleep 60

For 60 seconds vagrant boxes are running, but the second the job finishes vagrant boxes are aborted.

4

2 回答 2

9

This behaviour is caused by the Jenkins process tree killer. I got it to work by running Jenkins as follows:

java -Dhudson.util.ProcessTree.disable=true -jar jenkins-1.537.war

Another (less global) work-around is to run vagrant as follows:

BUILD_ID=dontKillMe vagrant up

Makes sense in retrospect. Processes launched by a Jenkins job should be cleaned up at the end. Of course this would be a "gotcha" is you're attempting to use Jenkins to launch long running processes.

+1 for this question.

于 2013-11-02T16:10:28.403 回答
-1

Maybe you are using an older version of the Jenkins plugin, but now it contains a checkbox called 'Don't Kill Me'. You have to check this to keep the vm up.

'jenkins config'

于 2017-03-07T18:58:42.517 回答