Jenkins中无法启动子进程的解决办法
来源:互联网 发布:商务数据分析与应用 编辑:程序博客网 时间:2024/06/06 01:46
在研究这个问题的时候,找到了另外一篇文章:https://wiki.jenkins-ci.org/display/JENKINS/ProcessTreeKiller,这篇文章进一步描述了Hudson杀掉衍生进程的情况:
The ProcessTreeKiller takes advantage of the fact that by default a new process gets a copy of the environment variables of its spawning/creating process.
It sets a specific environment variable in the process executing the build job. Later, when the user requests to stop the build job’s process it gets a list of all processes running on the computer and their environment variables, and looks for the environment variable that it initially set for the build job’s process.
Every job with that environment variable in its environment is then terminated.
意思就是说,Jenkins会在执行Job时设置一系列的环境变量,这些环境变量将被Job衍生出的进程所继承。Jenkins在Kill掉衍生进程的时候会查看进程的环境变量,如果找到它之前设置的环境变量,就将其杀掉。
因此,Wiki中也给出了另外一个简单的方法来避免进程被杀掉:
A convenient way to achieve that is to change the environment variable BUILD_ID which Jenkins’s ProcessTreeKiller is looking for. This will cause Jenkins to assume that your daemon is not spawned by the Jenkins build.
修改Hudson设置的环境变量BUILD_ID的值,从而让Jenkins认为此进程不是由Job的构建过程衍生的,如:
BUILD_ID=dontKillMe /usr/apache/bin/httpd
后面的”/usr/apache/bin/httpd”可以省略,即只需要在parameter build trigger中加入一个string parameter,变量名为BUILD_ID,值为dontKillMe即可。
- Jenkins中无法启动子进程的解决办法
- Jenkins中无法启动子进程的解决办法
- Jenkins中无法启动子进程的解决办法
- CreateProcess函数启动子进程出错的原因
- jenkins无法下载插件的解决办法
- vc++启动子进程
- jenkins 的html report 无法显示的解决办法
- Tomcat下部署Jenkins无法打开(404)的解决办法
- 关闭进程命令及无法结束进程的解决办法
- Linux下调用fork或system启动子进程的信号和资源释放相关问题
- Linux下调用fork或system启动子进程的信号和资源释放相关问题
- Linux下调用fork或system启动子进程的信号和资源释放相关问题
- Linux下调用fork或system启动子进程的信号和资源释放相关问题
- Jenkins中svn地址有多个,SVN_URL失效的解决办法
- JAVA中的Runtime启动子进程并杀掉
- C#导出Excel后无法结束相应进程的解决办法
- Windows中无法删除文件的解决办法
- Debian 中无法执行Sudo的解决办法
- rocketmq事务消息的理解
- 数据结构--线性结构
- loadrunner Web_类函数之web_set_sockets_option()
- 【Angular2】新建Angular2项目
- java输出菱形
- Jenkins中无法启动子进程的解决办法
- 枚举类的二三事
- 强大的Handler详细分析
- oracle 解析XML
- GetLastError函数使用及返回代码对照
- 用秦九昭公式计算多项式
- AT命令
- 由浅入深理解傅里叶—— 看完你还不懂的话,你可以回来掐死我(原作者说的,要掐掐死他)
- poj1860(spfa)