Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Processes spawned by a job are/may not be stopped or killed by Hudson when manually stopping the execution of the job.

However Hudson already contains such functionality, the so called ProcessTreeKiller.

To enable it you must set a Java property named "hudson.util.ProcessTreeKiller" to the value "true".

This can be done as a parameter to the "java" binary when starting Hudson:

 java -Dhudson.util.ProcessTreeKiller=true -jar hudson.war

There may be other ways to permanently enable the ProcessTreeKiller.

The ProcessTreeKiller itself takes advantage of the fact that by default a new process gets a copy of the environment variables of its spawning/creating process:

It sets a specific environment variable in the process executing the build job. Later, when the user requests to stop the build job's process it gets a list of all processes running on the computer and their environment variables, and looks for the environment variable that it initially set for the build job's process.

Every job with that environment variable in its environment is then being terminated.

  • No labels