Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit code 0 when terminating in the WebUI #3052

Open
maleadt opened this issue Oct 24, 2024 · 0 comments
Open

Exit code 0 when terminating in the WebUI #3052

maleadt opened this issue Oct 24, 2024 · 0 comments

Comments

@maleadt
Copy link

maleadt commented Oct 24, 2024

The documentation states that buildkite-agent should exit with code 255 if "The agent was gracefully terminated". I assumed that this would be the case when clicking the "Stop Agent" button in the WebUI, however, it seems like that simply exits with code 0.

This is a problem for me, because I run buildkite-agent in one-shot mode, i.e., passing --disconnect-after-job. In that case, it's impossible to distinguish between a completed or canceled job (both exiting with code 0, as expected) and one where I requested the agent to terminate (where I expected code 255). I would like this information to do something like:

while true; do
    buildkite-agent --disconnect-after-job
    if [[ ret -eq 255]; then
        break
    fi
done

FYI, I'm using --disconnect-after-job for containerization purposes, running all of buildkite-agent under sandbox-exec or docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant