启动时若提示下述内容,则表示启动失败

Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.

我们按照提示输入命令,进行失败原因查看:

systemctl status jenkins.service

输出内容:

[root@localhost jenkins]# systemctl status jenkins.service
● jenkins.service - LSB: Jenkins Automation Server
   Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2020-10-20 17:16:40 CST; 4min 10s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 10018 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)

Oct 20 17:16:40 localhost.localdomain systemd[1]: Starting LSB: Jenkins Automation Server...
Oct 20 17:16:40 localhost.localdomain runuser[10023]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
Oct 20 17:16:40 localhost.localdomain jenkins[10018]: Starting Jenkins bash: /usr/bin/java: No such file or directory
Oct 20 17:16:40 localhost.localdomain runuser[10023]: pam_unix(runuser:session): session closed for user jenkins
Oct 20 17:16:40 localhost.localdomain jenkins[10018]: [FAILED]
Oct 20 17:16:40 localhost.localdomain systemd[1]: jenkins.service: control process exited, code=exited status=1
Oct 20 17:16:40 localhost.localdomain systemd[1]: Failed to start LSB: Jenkins Automation Server.
Oct 20 17:16:40 localhost.localdomain systemd[1]: Unit jenkins.service entered failed state.
Oct 20 17:16:40 localhost.localdomain systemd[1]: jenkins.service failed.

从第10行我们可以看出jenkins没有找到java文件,需要自己把java文件地址复制过去

vi /etc/init.d/jenkins

手动输入对应服务器中的java路径:

接下来我们再启动jenkins,就可以成功了。

 

Jenkins系列文章:

一、Jenkins 系列教程-史上最简单Jenkins教程,教你一天学会使用Jenkins利器

二、Centos 安装nodejs

三、Centos 安装Maven

四、Linux下安装java JDK

五、jenkins启动报错 Job for jenkins.service failed because the control process exited with error code.

六、jenkins启动成功,警告Warning: jenkins.service changed on disk.

七、Jenkins以root用户运行

八、Jenkins配置中文语言

九、Jenkins 报mvn:command not found、npm:command not found

十、Jenkins批量删除构建历史

十一、Jenkins 部署前后端分离构建多git项目,打包后远程部署服务器

十二、ssh-copy-id输入密码后Permission denied, please try again.

十三、Jenkins Publish over SSH、SSH免密登录、SCP免密传输、Jenkins远程传输文件、Jenkins远程部署

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐