LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-28-2012, 03:35 PM   #1
userbrian
LQ Newbie
 
Registered: Jun 2008
Location: SF Bay area california
Distribution: Fedora 9
Posts: 15

Rep: Reputation: 0
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
 
Old 03-30-2012, 12:53 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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
 
Old 03-31-2012, 02:12 PM   #3
userbrian
LQ Newbie
 
Registered: Jun 2008
Location: SF Bay area california
Distribution: Fedora 9
Posts: 15

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trigger jenkins build with URL trigger when using git? jonizen Linux - Server 1 10-14-2011 01:07 PM
LXer: Continuous Deployment With Jenkins And Rex LXer Syndicated Linux News 0 09-21-2011 06:50 AM
Coding Dilemma: Build application with PHP framework or build all myself? socceroos Programming 2 05-10-2009 06:04 PM
C server program to be used for continuous monitoring of some status. NancyT Programming 2 04-17-2009 09:23 AM
Is your Sun Java System application server starting up? crisostomo_enrico Solaris / OpenSolaris 3 09-29-2007 06:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration