Skip to content

Commit 998488a

Browse files
fix(scripts): replace kill 0 with jobs -p to avoid killing parent process group
kill 0 sends SIGTERM to the entire process group including the parent shell/CI harness, causing segfaults on normal exit. Use jobs -p to target only this script's background jobs. Split INT/TERM from EXIT to avoid re-entrant cleanup. Assisted-by: Claude Code Co-Authored-By: Claude Code <noreply@anthropic.com>
1 parent 49ef790 commit 998488a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.rhdh/scripts/install-rhdh-catalog-source.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ pushd "${TMPDIR}" > /dev/null
626626
debugf ">>> WORKING DIR: $TMPDIR <<<"
627627

628628
# shellcheck disable=SC2064
629-
trap "rm -fr $TMPDIR || true; kill 0" EXIT INT TERM
629+
trap "rm -fr $TMPDIR || true; jobs -p | xargs -r kill 2>/dev/null; wait 2>/dev/null" EXIT
630+
trap "exit 1" INT TERM
630631

631632
detect_ocp_and_set_env_var
632633
if [[ "${IS_OPENSHIFT}" = "true" ]]; then

0 commit comments

Comments
 (0)