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

● jenkins.service - LSB: Jenkins Automation Server
   Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since 一 2019-06-10 18:22:24 CST; 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 24344 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)

6月 10 18:22:24 pinyoyougou-docker systemd[1]: Starting LSB: Jenkins Automation Server...
6月 10 18:22:24 pinyoyougou-docker runuser[24345]: pam_unix(runuser:session): session opened for us...=0)
6月 10 18:22:24 pinyoyougou-docker jenkins[24344]: Starting Jenkins bash: /usr/bin/java: 没有那个文…目录
6月 10 18:22:24 pinyoyougou-docker systemd[1]: jenkins.service: control process exited, code=exited...s=1
6月 10 18:22:24 pinyoyougou-docker jenkins[24344]: [失败]
6月 10 18:22:24 pinyoyougou-docker systemd[1]: Failed to start LSB: Jenkins Automation Server.
6月 10 18:22:24 pinyoyougou-docker systemd[1]: Unit jenkins.service entered failed state.
6月 10 18:22:24 pinyoyougou-docker systemd[1]: jenkins.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

在这里插入图片描述
看到原因是因为:
在这里插入图片描述
解决方案:
决方法:
1> 查看当前Java的环境变量 echo $JAVA_HOME
2> 复制Java的环境变量地址, 编辑/etc/init.d/jenkins文件, 指定位置添加该地址, 后缀附上/bin/java vim /etc/init.d/jenkins
修改后重启jenkins服务, 问题解决 systemctl start jenkins
在这里插入图片描述
结果,又有一个警告
在这里插入图片描述
解决方案:

systemctl daemon-reload

然后重启jenkis

systemctl restart jenkins重启
Logo

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

更多推荐