puppetserver: auto-restart JVM when its binaries are replaced by an upgrade #499
Reference in New Issue
Block a user
Delete Branch "benvin/puppetserver-jvm-restart-on-upgrade"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
An out-of-band OpenJDK upgrade (java-17-openjdk 17.0.18 -> 17.0.19, delivered by the AlmaLinux repo migration in #496) removed the old versioned JAVA_HOME while the puppetserver JVMs kept running against the now-deleted files. The running JVM re-execs
jspawnhelperfrom its original (deleted) JAVA_HOME on every posix_spawn, soProcessBuilderfails witherror=2, No such file or directory. That broke the exec ENC (/opt/cobbler-enc/cobbler-enc) and 500'd every catalog compile across all 6 masters, failing 136/143 nodes. The masters could not self-heal because nothing restarts the JVM after a java upgrade. Incident was resolved by manually restarting puppetserver on all 6 masters.Change
/usr/local/bin/puppetserver_jvm_guard.sh: restarts puppetserver if a running JVM (puppet-server-release.jar) is executing from deleted binaries.puppetserver-jvm-guardsystemd timer (every 5 min, mirrors the existing generate-types timer pattern) that runs the guard, so any future JVM/library upgrade recovers automatically.https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv