gpt4 book ai didi

ubuntu - 在 Ubuntu 18.04 LTS 中安装 Jenkins 失败(无法启动 LSB : Start Jenkins at boot time.)

转载 作者:太空宇宙 更新时间:2023-11-03 16:42:07 28 4
gpt4 key购买 nike

[症状]

  • 使用官方步骤安装 Jenkins,但失败并显示错误消息无法启动 LSB:在启动时启动 Jenkins
  • 重现步骤

    wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
    sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"
    sudo apt install jenkins
  • 控制台日志

    gaspar@jenkins:~$ sudo apt install jenkins
    ...
    Setting up default-jre-headless (2:1.9-62ubuntu2) ...
    Setting up jenkins (2.107.2) ...
    Job for jenkins.service failed because the control process exited with error code.
    See "systemctl status jenkins.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript jenkins, action "start" failed.
    ● jenkins.service - LSB: Start Jenkins at boot time
    Loaded: loaded (/etc/init.d/jenkins; generated)
    Active: failed (Result: exit-code) since Thu 2018-04-19 10:03:05 UTC; 9ms ago
    Docs: man:systemd-sysv-generator(8)
    Process: 27282 ExecStart=/etc/init.d/jenkins start (code=exited, status=7)
    Apr 19 10:03:03 evt-jenkins systemd[1]: Starting LSB: Start Jenkins at boot time...
    Apr 19 10:03:03 evt-jenkins jenkins[27282]: * Starting Jenkins Automation Server jenkins
    Apr 19 10:03:03 evt-jenkins su[27313]: Successful su for jenkins by root
    Apr 19 10:03:03 evt-jenkins su[27313]: + ??? root:jenkins
    Apr 19 10:03:03 evt-jenkins su[27313]: pam_unix(su:session): session opened for user jenkins by (uid=0)
    Apr 19 10:03:03 evt-jenkins su[27313]: pam_unix(su:session): session closed for user jenkins
    Apr 19 10:03:05 evt-jenkins jenkins[27282]: ...fail!
    Apr 19 10:03:05 evt-jenkins systemd[1]: jenkins.service: Control process exited, code=exited status=7
    Apr 19 10:03:05 evt-jenkins systemd[1]: jenkins.service: Failed with result 'exit-code'.
    Apr 19 10:03:05 evt-jenkins systemd[1]: Failed to start LSB: Start Jenkins at boot time.
    dpkg: error processing package jenkins (--configure):
    installed jenkins package post-installation script subprocess returned error exit status 1
    ...

[环境]

  • Ubuntu 18.04 LTS Beta2
  • Jenkins 2.107.2

最佳答案

[根本原因]

  • Ubuntu 18.04 LTS 使用 Java 9 作为默认 java
  • Jenkins 2.107.2 仍然使用 Java 8

[解决方案]

  • 在安装 Jenkins 之前先安装 Java 8

    sudo add-apt-repository ppa:webupd8team/java
    sudo apt install oracle-java8-installer
    wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
    sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"
    sudo apt-get update
    sudo apt install jenkins

关于ubuntu - 在 Ubuntu 18.04 LTS 中安装 Jenkins 失败(无法启动 LSB : Start Jenkins at boot time.),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49937743/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com