Project

General

Profile

Actions

Bug #34130

open

Puppetserver runs under Java 8 instead of Java 11 in Katello scenario

Added by Eric Helms almost 3 years ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

The puppet-candlepin configuration we have is designed to install and ensure Java 11 is present and Tomcat runs under this version. Which it does:

● tomcat.service - Apache Tomcat Web Application Container
   Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2021-12-10 16:11:33 UTC; 43min ago
 Main PID: 2405 (java)
    Tasks: 77 (limit: 50720)
   Memory: 1004.8M
   CGroup: /system.slice/tomcat.service
           └─2405 /usr/lib/jvm/jre-11/bin/java

However, one of the dependencies of Tomcat is tomcatjss which has a requires on openjdk-1.8.0:

[root@pipe-katello-server-nightly-centos8 vagrant]# rpm -q tomcatjss --requires
apache-commons-lang3
java-1.8.0-openjdk-headless
jpackage-utils >= 0:1.7.5-15
jss >= 4.9.0
jss < 5.0.0
pki-servlet-engine >= 1:9.0.7
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
slf4j
slf4j-jdk14

This leads to the default java version being 8 and not 11:

[root@pipe-katello-server-nightly-centos8 vagrant]# update-alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64/jre/bin/java)
   2           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-3.el8_5.x86_64/bin/java)

Puppetserver's start up command relies on calling /usr/bin/java which is always set to whatever the current alternative is set to. This means that Puppetserver ends up running under Java 8 instead of the newer Java 11:

● puppetserver.service - puppetserver Service
   Loaded: loaded (/usr/lib/systemd/system/puppetserver.service; enabled; vendor preset: disabled)
   Active: activating (start) since Fri 2021-12-10 16:52:58 UTC; 8s ago
Cntrl PID: 20787 (bash)
    Tasks: 37 (limit: 4915)
   Memory: 503.2M
   CGroup: /system.slice/puppetserver.service
           ├─20787 bash /opt/puppetlabs/server/apps/puppetserver/cli/apps/start
           ├─20816 /usr/bin/java

We either need to solve this packaging problem (we get tomcatjss from pki-core) or find a way to adjust the alternatives to ensure Java 11 is the default enabled.

Actions

Also available in: Atom PDF