Jenkins安装启动报错Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
[root@localhost jenkins]# systemctl start jenkins
Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
[root@localhost jenkins]# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/usr/lib/systemd/system/jenkins.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Tue 2023-02-21 18:59:14 CST; 30s ago
Process: 9388 ExecStart=/usr/bin/jenkins (code=exited, status=1/FAILURE)
Main PID: 9388 (code=exited, status=1/FAILURE)
Feb 21 18:59:14 localhost.localdomain systemd[1]: Failed to start Jenkins Continuous Integration Server.
Feb 21 18:59:14 localhost.localdomain systemd[1]: Unit jenkins.service entered failed state.
Feb 21 18:59:14 localhost.localdomain systemd[1]: jenkins.service failed.
Feb 21 18:59:14 localhost.localdomain systemd[1]: jenkins.service holdoff time over, scheduling restart.
Feb 21 18:59:14 localhost.localdomain systemd[1]: Stopped Jenkins Continuous Integration Server.
Feb 21 18:59:14 localhost.localdomain systemd[1]: start request repeated too quickly for jenkins.service
Feb 21 18:59:14 localhost.localdomain systemd[1]: Failed to start Jenkins Continuous Integration Server.
Feb 21 18:59:14 localhost.localdomain systemd[1]: Unit jenkins.service entered failed state.
Feb 21 18:59:14 localhost.localdomain systemd[1]: jenkins.service failed.
网上发布到各种Jenkins安装方式都没有提到需要提前创建Jenkins所需目录,以至于执行yum install jenkins时,看到complete!会忽略掉安装过程中所报异常。

解决方法:
排查jenkins安装所需目录是否存在
/var/cache/jenkins /var/lib/jenkins /var/log/jenkins
若不存在,创建后重新执行yum install jenkins
并重新加载服务 systemctl daemon-reload
启动Jenkins systemctl start jenkins

文章描述了在尝试启动Jenkins服务时遇到的错误,问题在于系统没有预先创建必要的目录。解决方案是检查并创建目录`/var/cache/jenkins`、`/var/lib/jenkins`和`/var/log/jenkins`,然后重新执行`yuminstalljenkins`,再进行服务的重新加载和启动。
535

被折叠的 条评论
为什么被折叠?



