Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37686 - Stop puppetserver if java is too old #953

Merged

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Jul 25, 2024

When upgrading from puppetserver 7 to puppetserver 8 it'll typically be configured with /usr/bin/java and that usually points to Java 8. Puppetserver 8 has started to require Java 11, so upgrading fails.

By properly stopping the service before running Puppet we know for sure that it can be started safely again. It also helps free up CPU from the constant restart loop, which reduces the slowdown.

Copy link
Member

@evgeni evgeni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack once tests pass

When upgrading from puppetserver 7 to puppetserver 8 it'll typically be
configured with /usr/bin/java and that usually points to Java 8.
Puppetserver 8 has started to require Java 11, so upgrading fails.

By properly stopping the service before running Puppet we know for sure
that it can be started safely again. It also helps free up CPU from the
constant restart loop, which reduces the slowdown.
@ekohl ekohl force-pushed the 37686-work-around-puppetserver-and-old-java branch from ddb6b36 to 9883362 Compare July 26, 2024 17:06
@ekohl ekohl merged commit 9883362 into theforeman:develop Jul 29, 2024
8 checks passed
@ekohl ekohl deleted the 37686-work-around-puppetserver-and-old-java branch July 29, 2024 10:31
logger.debug("Found Puppetserver #{puppetserver_match[:version]}")
if puppetserver_match[:version] == '8'
java_stdout_stderr, _status = execute_command("source #{sysconfig_file} ; $JAVA_BIN -version", false, true)
java_stdout_stderr&.match(/version "\d+\.(?<version>\d+)\.\d+/) do |java_match|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works well for:

openjdk version "1.8.0_412"

But not for:

openjdk version "17.0.13" 2024-10-15 LTS

or

openjdk version "11.0.25" 2024-10-15 LTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants