How to prevent auto-closing of Tomcat on starting from Jenkins job?

I am trying to start Tomcat in my Jenkins job on a slave machine.
I start Jenkins slave manually by opening slave-agent.jnlp

This is what I tried in Execute Windows Batch Command:

  • Run external tool before GIT commit in PHPStorm
  • Automatically cache git credentials from a Windows batch script?
  • Git add submodules to super project from existing repos
  • Is there a way to force a commiter enter their username in git bash
  • TortoiseGit Git Commit message from script
  • use cd in windows .bat file has no effect
  • call C:\tomcat\bin\startup.bat
    

    Tomcat starts on running the build and the build is marked successful but then Tomcat auto closes after few seconds.

  • How to get Selenium/WebDriver tests running on Jenkins?
  • Fetch from one git server and push to another server using Jenkins
  • sparse checkout gives me an error stderr: fatal: Not a valid object name HEAD
  • How to log into git bitbucket repository from jenkins
  • Setup Jenkins to monitor external job
  • Changing Jenkins Build Name & Description through API in JAVA
  • One Solution collect form web for “How to prevent auto-closing of Tomcat on starting from Jenkins job?”

    This is Jenkins Process Tree Killer in action. This is by design. You can either disable it globally for the whole Jenkins (not recommended) by starting Jenkins with extra parameter
    -Dhudson.util.ProcessTree.disable=true.

    For Windows environment, you can use the at command to schedule start of Tomcat (with 1 sec delay).

    Git Baby is a git and github fan, let's start git clone.