Stopping/Cancelling a job in TC uses SIGKILL on Linux agent


I wanted to see if anybody knew why stopping/cancelling a job uses SIGKILL/kill -9 on a linux agent. This is causing some headaches as there are some shutdown hooks that need to be run if a build is forcefully stopped and using SIGKILL prevents those from running.

Is there a way to change this behavior in the agnet settings or in TC?


1 comment
Comment actions Permalink

Hi John,

No, it is not possible to change it in agent settings.
You can use build step execution condition "Always, even if build stop command was issued" - this should run even if the build was stopped by a user.
Another approach is to create a TeamCity agent plugin (in any of the JVM, Java-interoperable languages) which will do what you need.
For more reliable solution please see/vote for


Please sign in to leave a comment.