From b8f2bd73435ba1b10b45bf790192a43f907a9a56 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Fri, 31 Jul 2026 01:59:36 -0400 Subject: [PATCH] [FIX] update_manifest_local_dev: git daemon doublon -> exit 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A leftover git daemon from an interrupted run kept port 9418, so the new daemon failed to bind ("Address already in use") and the final « kill $DAEMON_PID » failed on the already-dead PID, returning exit 1. That non-zero status bubbled up through apply_extra_modules() and set exit_code=1, which silently skipped the post-install steps (add_extra_to_config_conf, generate_config) -> CybroOdoo never landed in config.conf. - Kill any leftover daemon before starting a new one. Match the stable arguments, not "git daemon": « git daemon » execs into « git-daemon » (hyphen, /usr/lib/git-core/git-daemon), so a "git daemon" (space) pattern never matched the actual process. - Move daemon cleanup into an EXIT trap that tolerates an already-dead PID, so the script never exits non-zero just because the daemon is already gone. Co-Authored-By: Claude Opus 4.8 (1M context) --- script/manifest/update_manifest_local_dev.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/script/manifest/update_manifest_local_dev.sh b/script/manifest/update_manifest_local_dev.sh index abdc5c3..122978f 100755 --- a/script/manifest/update_manifest_local_dev.sh +++ b/script/manifest/update_manifest_local_dev.sh @@ -12,9 +12,22 @@ fi #EL_MANIFEST_PROD="./default.xml" #EL_MANIFEST_DEV="./manifest/default.dev.xml" -# Update git-repo +# Update git-repo : local git daemon serving the repo over git://127.0.0.1:9418. +# Kill any leftover daemon from a previous (interrupted) run first: otherwise the +# stale server keeps port 9418, the new daemon fails to bind ("Address already in +# use"), and the cleanup kill below fails on an already-dead PID -> script exit 1. +# Match on the stable arguments, not "git daemon": « git daemon » execs into +# « git-daemon » (hyphen, /usr/lib/git-core/git-daemon), so "git daemon" (space) +# never matches the actual running process. +if pkill -f "daemon --base-path=. --export-all" 2>/dev/null; then + sleep 1 # let the kernel release port 9418 before we rebind +fi + git daemon --base-path=. --export-all --reuseaddr --informative-errors ${DAEMON_VERBOSE} & DAEMON_PID=$! +# Always stop the daemon we started, whatever happens next (success or error), +# without ever failing the script if it is already gone. +trap 'kill "${DAEMON_PID}" 2>/dev/null || true' EXIT if [ -L "$EL_MANIFEST_DEV" ]; then MANIFEST_TARGET=$(readlink -f "$EL_MANIFEST_DEV") @@ -34,4 +47,4 @@ fi .venv.erplibre/bin/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --verify HEAD) -m ${MANIFEST_TARGET} "$@" .venv.erplibre/bin/repo sync -c -j "$JOBS" ${REPO_VERBOSE} -m ${MANIFEST_TARGET} -kill ${DAEMON_PID} +# Daemon cleanup handled by the EXIT trap above (tolerant of an already-dead PID).