Today, there is a problem with automating Jenkins deployments. I will kill other processes while executing the shell script, and this process is no longer executing, looking for resources and finding an article.
This is because Jenkins by default will kill all the derivative processes after the build is finished.
Workaround:
1. Reset environment variable build_id
Add Build_id=dontkillme to the Execute shell input box to prevent Jenkins from killing the startup Java process
2. Prohibit Jenkins from killing the derivative process when initiating Jenkins (this method is not tested and is one of the solutions)
Modify the/etc/sysconfig/jenkins configuration and add-dhudson.util.processtree.disable=true to the jenkins_java_options. Need to reboot Jenkins to take effect
Once this method is configured once, all jobs do not need to set build_id to prevent Jenkins from killing the started Java process
Picture Original Url:https://wiki.jenkins.io/display/jenkins/processtreekiller