Imagine that you have to start a service in a remote Linux machine from Jenkins using, for example, an Ant script. You'll notice that the service starts normally, but it stops working after Jenkins has finished its task. This happens because the design of Jenkins automatically kills any process left running in Linux machines. I imagine that this is because they didn't want to leave any garbage in the managed machines. However, sometimes this is an annoying problem and it usually takes a lot of time to get rid of.
To solve this, open the Jenkins dashboard an go to: Manage Jenkins > Configure System
To solve this problem with Jenkins you have to configure an internal environment variable. To do that, go to the "Global Properties" section and check "Environment variables":
Now click Add. In "name", enter BUILD_ID. In "value" enter dontKillMe. Then click "Save".
That's all! From now on, Jenkins won't kill the processes it started in Linux machines. Give it a try!