This plugin is up for adoption. Want to help improve this plugin? Click here to learn more!
About this plugin
By default, Jenkins don't terminate Cygwin process trees on timeouts and manual termination of builds on Windows platforms. This is caused by Cygwin architecture, but it is very painful in automation environments, because unterminated processes may modify files and even lock workspace for the future builds. This plugin implements proper termination of Cygwin process trees in Jenkins jobs. See JENKINS-13615 for more info.
Due to the current implementation of Jenkins core, this plugin version works only for processes, which are the children of the parent process being terminated by Jenkins.
- Jenkins Core should contain fix for invocation of Process Killers on Windows (see JENKINS-19156 for more info)
- You should use only one Cygwin installation on the host
- Due to Cygwin's architecture, ps commands discovers processes running within the same cygwin1.dll
- Other processes will be ignored
By default, plugin is disabled. After the installation, plugin should be configured via Jenkins global configuration page.
Approach 1. Minimal configuration
Steps below allow to use Cygwin Process Killer, which relies on global environment variables during the process termination. Please note that this approach is not recommended due to possible conflicts with other utilities.
- Go to "Cygwin process killer" section of the global configuration page
- Click on "Enable killer" checkbox to enable the plugin
Approach 2. Configure the plugin to use Cygwin tool installations
This section describes setup of Cygwin Killer for installations without configured Cygwin environment
- Configure the "Cygwin Process Killer" installation
- Tool's home should point to CYGWIN_HOME (root folder with bin and lib folders)
- %CYGWIN_HOME%\bin must contain uname.exe and bash.exe utilities
- You can use any tool installer. You also can configure local installation via individual node configurations.
- Save and reopen the configuration. Then, go to the "Cygwin process killer" section
- Click on the "Use Cygwin from a tool installation" checkbox
- Select a tool installation from the list
- You can customize process termination scripts. If you have a version for execution with "-ex" flags, please create a pull request ASAP :)
- Extended logging and support of various interpreters
- Automatic definition of used cygwin1.dll
- Support of a graceful process termination (the current version invokes "kill -9")
- "Restore default" script button in the web interface
Version 0.2 (Jan 31, 2018)
- Require Jenkins Core 1.625.3 or above
- Fix issues reported by FindBugs and injected tests
Version 0.1 (10/25/2013)
- Initial version of the plugin