LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   jenkins continuous build server not starting application (https://www.linuxquestions.org/questions/programming-9/jenkins-continuous-build-server-not-starting-application-936943/)

userbrian 03-28-2012 03:35 PM

jenkins continuous build server not starting application
 
Hi All,
I have a jenkins build server running that has a "slave" as well.
The slave is a centos box and the jenkins master communicates with it via ssh. No problem there. The slave builds and deploys a server (test environment) and everything looks good but after my jenkins process terminates so does my server.

After some investigation I have discovered that my server is receiving a SIGTERM. I believe this is coming when the ssh communication, between jenkins master and slave, terminates.

So what I want is to have my process continue even though the shell that starts it has terminated.

The process is being started in daemon mode (i.e. we fork the process at startup).

I believe it is just a configuration issue but I don't know what to change. Any ideas?

Thanks,
-brian

EricTRA 03-30-2012 12:53 AM

Hello,

How exactly are you starting Jenkins (full command please)? I have three instances of Jenkins running on the same server and each one has build slaves (over SSH) and not once has an instance 'died' like you explain.

Kind regards,

Eric

userbrian 03-31-2012 02:12 PM

Hi Eric,
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

cd $EXEDIR
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
sleep(15)
pidof $ServerName

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.


-brian


All times are GMT -5. The time now is 10:50 AM.