LoginSignup
3
1

More than 3 years have passed since last update.

Java バージョンアップによる Jenkins 起動不全

Last updated at Posted at 2020-11-24

Ubuntu をアップデート後、Jenkins が起動しなくなってしまった。

Jenkins 起動不全

$ systemctl status jenkins.service
● jenkins.service - LSB: Start Jenkins at boot time
   Loaded: loaded (/etc/init.d/jenkins; generated)
   Active: failed (Result: exit-code) since Sun 2020-11-15 14:20:39 UTC; 19s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1591 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)
Nov 15 14:20:39 ip-172-31-83-123 systemd[1]: Starting LSB: Start Jenkins at boot time...
Nov 15 14:20:39 ip-172-31-83-123 jenkins[1591]: Found an incorrect Java version
Nov 15 14:20:39 ip-172-31-83-123 jenkins[1591]: Java version found:
Nov 15 14:20:39 ip-172-31-83-123 jenkins[1591]: openjdk version "11.0.9.1" 2020-11-04
Nov 15 14:20:39 ip-172-31-83-123 jenkins[1591]: OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.18.04)
Nov 15 14:20:39 ip-172-31-83-123 jenkins[1591]: OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.18.04, mixed mode, sharing)
Nov 15 14:20:39 ip-172-31-83-123 jenkins[1591]: Aborting
Nov 15 14:20:39 ip-172-31-83-123 systemd[1]: jenkins.service: Control process exited, code=exited status=1
Nov 15 14:20:39 ip-172-31-83-123 systemd[1]: jenkins.service: Failed with result 'exit-code'.
Nov 15 14:20:39 ip-172-31-83-123 systemd[1]: Failed to start LSB: Start Jenkins at boot time.

解消方法

/etc/init.d/jenkins を以下のように編集

【Before】

# Which Java versions can be used to run Jenkins
JAVA_ALLOWED_VERSIONS=( "18" "110" )

【After】

# Which Java versions can be used to run Jenkins
JAVA_ALLOWED_VERSIONS=( "18" "110" "11.09" )

Jenkins 再起動

$ sudo systemctl restart jenkins
Warning: The unit file, source configuration file or drop-ins of jenkins.service changed on disk. Run 'systemctl daemon-reload' to reload units.

原因

以下のコマンドで Ubuntu をアップデートした際、Java のバージョンが上がってしまった模様

$ sudo apt update
$ sudo apt dist-upgrade
$ sudo apt autoremove

参考記事

jenkins — 「サービス開始ジェンキン」を実行するとジェンキンが失敗する

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1