I think I may have mislead you. Jenkins the master is running and jenkins the slave is running but when the communication between the master and the slave finishes then process started by the slave receive a SIGTERM and die.
One job simply runs a bash command which looks something like
bash ./restart.sh -port <num> -daemon
where restart.sh is a convenience script that sets more arguments, kills the existing server, renames the log file and finally (re)starts my new server.
I have added to my bash command things like
Which shows that my server that I started is still alive but dies when the jenkins script stops running.
I can increase (or decrease) the time to sleep and that determines how long my server process will live.
The problem, I believe, is that the parent pid, the communication shell, is being killed which in turns kills all the children pid(s). I think it is just a configuration value but I don't know which one.