#!jinja2
[cylc]
   [[events]]
       abort if any task fails = True
       abort on inactivity = True
       inactivity = PT2M

[scheduling]
    [[graph]]
        R1 = foo

[runtime]
    [[foo]]
        script = """
# Remove traps
wait "${CYLC_TASK_MESSAGE_STARTED_PID}" 2>/dev/null || true
trap '' EXIT
trap '' ERR
if [[ "${CYLC_TASK_SUBMIT_NUMBER}" == '1' ]]; then
    # Will be killed after PT5S
    sleep 40
else
    # Fake success
    cat >>"$0.status" <<__STATUS__
CYLC_JOB_EXIT=SUCCEEDED
CYLC_JOB_EXIT_TIME=$(date -u '+%FT%H:%M:%SZ')
__STATUS__
fi
exit
"""
        [[[job]]]
            execution time limit = PT10S
            execution retry delays = PT0S
