Skip to content

Declare the deb/rpm runtime dependencies (java, which, chkconfig)#677

Merged
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:issues/packaging-runtime-requires
Jul 8, 2026
Merged

Declare the deb/rpm runtime dependencies (java, which, chkconfig)#677
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:issues/packaging-runtime-requires

Conversation

@vharseko

@vharseko vharseko commented Jul 3, 2026

Copy link
Copy Markdown
Member

Audit of the deb/rpm dependency declarations against what the packages actually use (maintainer scripts + the server's shell scripts). Scoped for a minor release: declarations only, no packaging behavior changes (the packaging modernization itself is #663, targeted at the next major).

rpm: no Requires were declared at all

Actually used Where Declared
Java ≥ 11 the server itself ❌ — the rpm installed on a Java-less host, setup then fails
which _script-util.sh java discovery ❌ — absent on minimal RHEL 9, setup fails with "Please set OPENDJ_JAVA_HOME" (reproduced in CI: failing job)
/sbin/chkconfig postinstall.sh (--add), preuninstall.sh (--del), unconditionally ❌ — scriptlets fail on minimal systems

Now declared: java-headless >= 1:11, which, chkconfig.

deb: Depends matched only full JREs and stopped at Java 21

java11-runtime | java17-runtime | java21-runtime are provided by the full openjdk-NN-jre packages only. A server with just openjdk-NN-jre-headless (the common server setup) did not satisfy the alternatives, so apt pulled a second JRE (default-jre-headless). The list also lacked Java 25.

Now: default-jre-headless | default-jre | java25-runtime-headless | java25-runtime | java21-runtime-headless | java21-runtime | java17-runtime-headless | java17-runtime | java11-runtime-headless | java11-runtime

(update-rc.d — init-system-helpers — and which — debianutils — are Essential on Debian and need no declaration.)

The rpm declared no dependencies at all: it installed on a Java-less host
(setup then fails), its scripts locate java via "which" (absent on minimal
RHEL9 - setup fails with "Please set OPENDJ_JAVA_HOME"), and the
postinstall/preuninstall scriptlets call /sbin/chkconfig unconditionally.
Declare java-headless >= 1:11, which and chkconfig.

The deb Depends listed only the full javaNN-runtime virtual packages, so a
server with only openjdk-NN-jre-headless (the common server setup) did not
satisfy them and apt pulled a second JRE; the list also stopped at Java 21.
Add the javaNN-runtime-headless alternatives and Java 25.
@vharseko vharseko requested a review from maximthomas July 3, 2026 09:44
vharseko added a commit to vharseko/OpenDJ that referenced this pull request Jul 3, 2026
…anual installs from the deb/rpm tests

- rpm: add Requires: util-linux - postinstall runs the upgrade tool and the
  server via runuser unconditionally.
- test-rpm: no manual dependency installs; dnf must resolve everything from the
  package Requires (java-headless, util-linux, shadow-utils).
- test-deb-upgrade: drop the manual JRE (the released 5.1.1 deb declares a JRE
  dependency itself) and procps (the process-owner check now uses /proc stat).
- test-rpm-upgrade: keep only java + which, needed by the RELEASED 5.1.1 rpm
  which declared no dependencies at all (declarations added by OpenIdentityPlatform#677); drop them
  when the upgrade-source artifact link points to a release containing OpenIdentityPlatform#677.
vharseko added a commit to vharseko/OpenDJ that referenced this pull request Jul 4, 2026
/etc/redhat-release exists on every RHEL-family system, but the sourced
/etc/init.d/functions only exists when the optional initscripts package is
installed - so the init script aborted with "No such file or directory" on
minimal systems. Check for the function-library files themselves and fall
back to a self-contained default (the script does not depend on them).

test-rpm-upgrade: the RELEASED 5.1.1 init script has the same defect and
cannot be fixed, so install initscripts for the old package (alongside java
and which), to be dropped when the upgrade-source artifact points to a
release containing OpenIdentityPlatform#677.
The shipped /etc/init.d/opendj sources /etc/init.d/functions whenever /etc/redhat-release exists, and that file is provided by the optional initscripts package - on minimal RHEL-family systems the service script aborted with "No such file or directory" (reproduced in CI against the released 5.1.1 rpm).
@vharseko vharseko added the packaging deb/rpm/MSI, distribution layout, config.ldif label Jul 6, 2026
@vharseko vharseko merged commit ef36fe4 into OpenIdentityPlatform:master Jul 8, 2026
33 of 34 checks passed
@vharseko vharseko deleted the issues/packaging-runtime-requires branch July 8, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug build packaging deb/rpm/MSI, distribution layout, config.ldif

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants