如何更改詹金斯的主目录? [英] How to change home directory of Jenkins?
问题描述
简单问题:如何更改 jenkins 主目录位置?默认情况下它指向 /var/lib/jenkins
而我希望它指向 /home/jenkins
.我已将我的 $JENKINS_HOME
更改为 /home/jenkins
但它对我没有帮助.
Simple question: How to change the jenkins home directory location? By default it points to /var/lib/jenkins
whereas I want it to point to /home/jenkins
. I have changed my $JENKINS_HOME
to /home/jenkins
but it doesn't help me.
推荐答案
Jenkins 通常使用自己的用户运行,
因此更改该用户的主目录应该可以完成这项工作.
Jenkins usually runs with its own user,
so changing the home-dir of that user should do the job.
如果不确定,只需使用id"、whoami"或env"等 shell 命令运行测试作业,即可找到 Jenkins 使用的用户.
If not sure, simply run a test-job with a shell-command like 'id' or 'whoami' or 'env' to find the user that Jenkins uses.
另外,请注意Started by user anonymous
"消息并不意味着 Jenkins 以匿名用户身份启动 -
请查看 Sagar 和 彼得·特兰:
Also, note that a message of "Started by user anonymous
" does not mean that Jenkins started as an anonymous user -
please see this related answers by Sagar and Peter Tran:
这篇关于如何更改詹金斯的主目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!