Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Bring the note from the comment into an article itself

...

To reliably kill processes spawned by a job during a build, Hudson Jenkins contains a bit of native code to list up such processes and kill them. This is tested on several platforms and architectures, but if you find a show-stopper problem because of this, you can disable this feature by setting a Java property named "hudson.util.ProcessTreeKillerProcessTree.disable" to the value "true".

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

Code Block

 java -Dhudson.util.ProcessTreeKillerProcessTree.disable=true -jar hudsonjenkins.war

Depending on how you run your container, this can be different. In the distributed build environment, this system property needs to be set on slave JVMs.

Info

Older versions of Hudson (<1.315) used the Java Property hudson.util.ProcessTreeKiller.disable, but the class ProcessTreeKiller has been depecated since. For compatibility reasons, currently both property names are supported (as of version 1.404).

How it works

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

...

A convenient way to achieve that is to change the environment variable BUILD_ID which HudsonJenkins's ProcessTreeKiller is looking for. This will cause Hudson Jenkins to assume that your daemon is not spawned by the Hudson Jenkins build. For example:

Code Block

BUILD_ID=dontKillMe /usr/apache/bin/httpd
Info

In case of Jenkins Pipeline use JENKINS_NODE_COOKIE instead of BUILD_ID