mirror of
https://github.com/casjaysdevdocker/opengist
synced 2026-08-14 14:01:17 -04:00
Root cause: many functions in functions/entrypoint.sh ended with a bare, unguarded `[ "$DEBUGGER" = "on" ] && echo/printf/__service_banner ...` statement as their last executed line. With DEBUGGER unset (the default runtime case), the `[ ]` test is false, so the function's implicit return value is nonzero. Several of these functions (most critically __symlink, called bare from __setup_mta) are invoked as unguarded statements from other functions, and the whole entrypoint runs under `set -eo pipefail`, so the nonzero return aborted the entire script chain immediately after startup — explaining why the container only printed the first log line and exited 1, and why it only worked with DEBUGGER=on (which makes the echo run and return 0, masking the bug). Verified via two clean docker buildx build + run cycles: before the fix, `docker inspect` showed the container crash-looping (exit 1, ~3.9s uptime); after, `RestartCount=0 Status=running Health=healthy` with opengist fully started, DEBUGGER unset. - rootfs/usr/local/etc/docker/functions/entrypoint.sh: append `|| true` to all 26 bare `[ "$DEBUGGER" = "on" ] && ...` statements so their result never propagates as the enclosing function's return value - TODO.AI.md: log 20 pre-existing script-lint findings on the same file (missing `--` on grep, missing `local` on a few function-local vars, missing VERSION= line) found incidentally while diagnosing this bug; deferred as unrelated cleanup, not part of this fix
959 B
959 B
TODO.AI.md
Pre-existing script-lint findings on rootfs/usr/local/etc/docker/functions/entrypoint.sh,
found while fixing the container restart-loop bug. Not caused by that fix; deferred here
since they are unrelated cleanup, not a functional regression.
grepcalls missing--before the pattern (lines 80, 92, 111, 141, 169, 685, 741, 751, 812, 855, 901, 912, 936) — add--per~/.claude/memory/tool_conventions.md__fix_permissions()(line 737-738):change_user/change_groupassigned withoutlocal__initialize_db_users()(lines 1370-1373):db_normal_user,db_normal_pass,db_admin_user,db_admin_passassigned withoutlocal__initialize_custom_bin_dir()(line 1416):create_bin_nameassigned withoutlocal- No
VERSION=assignment in body to match the##@Versionheader (functions library — confirm whether versioning is required for this file type before adding)