mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
12 hours ago 9db63ab6e694fca23b93cb1cb059165930554c07
Start the Docker bootstrap server after setup exits (#1326)

## Summary

- Run Docker bootstrap setup with `--doNotStart`. Start the temporary
server only after the installer JVM exits, then configure the backend
and import data.
- Keep the temporary server's JVM argument resolution and fail bootstrap
if setup or startup fails.
- Launch the temporary server from `/opt/opendj/bin` so relative paths
in `start-ds.java-args` resolve as they did when the installer launched
it.

## Validation

- On the CI image at 512 MiB, completed bootstrap on an empty volume,
reached healthy status, and read the imported base entry over LDAPS.
- Sampled the JVMs during bootstrap and verified that the installer and
temporary server ran in sequence. The container still reached the 512
MiB limit in this run.
- Exercised command ordering and failure propagation on dash and BusyBox
sh. Ran `git diff --check`.
- Reproduced the relative GC log path failure on a local Docker image at
512 MiB. With the working directory restored, the log was written to
`/opt/opendj/data/logs/bootstrap-gc.log`, the container became healthy,
and the imported base entry was readable over LDAPS.
1 files modified
9 ■■■■■ changed files
opendj-packages/opendj-docker/bootstrap/setup.sh 9 ●●●●● patch | view | raw | blame | history
opendj-packages/opendj-docker/bootstrap/setup.sh
@@ -101,8 +101,17 @@
  --acceptLicense \
  --no-prompt \
  --noPropertiesFile \
  --doNotStart \
  $SETUP_ARGS || exit 1
# Let the setup JVM exit before starting the server needed by the online bootstrap steps.
(
  # Use the server's own JVM settings, as when setup invoked start-ds.
  unset OPENDJ_JAVA_ARGS CLASSPATH
  cd /opt/opendj/bin || exit 1
  exec /opt/opendj/bin/start-ds --timeout 0
) || exit 1
BACKEND_TYPE=${BACKEND_TYPE:-je}
BACKEND_DB_DIRECTORY=${BACKEND_DB_DIRECTORY:-db}
if [ "$HOLDS_DATA" = true ]; then