搭建环境 | 系统:centos 7 | Java 1.8 | jenkins 2.121.3-1.1 2.1
[root@master ~]# /etc/init.d/jenkins start
Starting jenkins (via systemctl): Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
[FAILED]
● jenkins.service - LSB: Jenkins Automation Serve
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2018-09-11 20:39:41 EDT; 2min 48s ago
Docs: man:systemd-sysv-generator(8)
Sep 11 20:39:38 master systemd[1]: Starting LSB: Jenkins Automation Server...
Sep 11 20:39:40 master runuser[11110]: pam_unix(runuser:session): session opened for ...=0)
Sep 11 20:39:41 master jenkins[11104]: Starting Jenkins bash: /usr/jdk1.8: Is a directory
Sep 11 20:39:41 master runuser[11110]: pam_unix(runuser:session): session closed for ...oot
Sep 11 20:39:41 master jenkins[11104]: [FAILED]
Sep 11 20:39:41 master systemd[1]: jenkins.service: control process exited, code=exit...s=1
Sep 11 20:39:41 master systemd[1]: Failed to start LSB: Jenkins Automation Server.
Sep 11 20:39:41 master systemd[1]: Unit jenkins.service entered failed state.
Sep 11 20:39:41 master systemd[1]: jenkins.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
修改配置文件:
candidates="
#/etc/alternatives/java
#/usr/lib/jvm/java-1.8.0/bin/java
#/usr/lib/jvm/jre-1.8.0/bin/java
#/usr/lib/jvm/java-1.7.0/bin/java
#/usr/lib/jvm/jre-1.7.0/bin/java
#/usr/bin/java
#/usr/jdk1.8
/usr/jdk1.8/bin/java
"
在candidates里插入自己的jdk java路径,其他的全部注释掉
#JENKINS_USER="jenkins"
JENKINS_USER="root"
JENKINS_USER 改成root
[root@master ~]# /etc/init.d/jenkins start
Starting jenkins (via systemctl): Warning: jenkins.service changed on disk. Run 'systemctl daemon-reload' to reload units.
[ OK ]
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。