Hudson Execute shell script (Hudson boot tomcat Invalid issue)

Source: Internet
Author: User

When using Hudson's execute SH script, if the SH script is a background process, such as TOMCAT services. If you use the default configuration of Hudson, you will find that the SH process has a start-up process, but will not be resident in the background, look at the Hudson output log, and discover that Hudson kill all the non-terminating derivative processes after the job build is completed.

A further description of the Hudson killing of the derivative process is described in Hudson on another wiki page. Hudson sets a series of environment variables that will be inherited by the job-derived process when the job is executed. Hudson will look at the environment variables of the process when the kill derivation process, and if it finds the environment variables set before it, kill them. A simple way to prevent the process from being killed is given on the wiki: Modify the value of the environment variable build_id set by the Hudson, so that Hudson thinks the process is not derived from the job's build process.


Method 1: Global Settings

Open: Hudson > System Management > System settings

Set build_id value to Allow_to_run_as_daemon



This allows us to execute the command to execute SH where we need to execute the SH script to start and stop Tomcat, for example:



Method 2: Set the build_id where you need to execute the SH script

Set the build_id directly inside the command and then execute the SH script, as follows:





-------------------------------------

Finish






HUDs

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Hudson Execute shell script (Hudson boot tomcat Invalid issue)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.