Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Jenkins "Execute shell" build step to see signals blocked by Jenkins and
- # so not-caught by child processes, such as apparently SIGQUIT (3).
- # Note this may behave slightly differently in different system shells -
- # e.g. bash did not block SIGINT (2) for me, but dash and ksh did.
- # You may want a shebang on top for deterministic behavior of a specific
- # shell, rather than current build agent's /bin/sh implementation.
- RES=0
- for SIG in 1 2 3 15 ; do
- echo "SIG = $SIG"
- ( trap "echo 'Got hit by $SIG' >&2 ; exit 0 ;" $SIG
- sleep 5
- echo "ERROR: Did not get SIG = $SIG" >&2
- exit 1 ) &
- sleep 1
- kill -$SIG $! || RES=$?
- wait $! || RES=$?
- done
- exit $RES
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement