Unable to successfully start a JBOSS service using Publish over SSH

425 views
Skip to first unread message

Eric Wood

unread,
Nov 4, 2014, 12:11:44 PM11/4/14
to Jenkinsci-users
I am attempting to stop and start a JBOSS service on a remote server and I am using the Publish over SSH plugin for this purpose.  I am running the service command

    service jbossas7.1 start

I can see it starting up, but the plugin does not seem to disconnect after a successful startup. Eventually the ssh connect timeouts and the build terminates in an UNSTABLE state.  Any idea how I can resolve this issue? The run line in the service script looks like this:

    su -s /bin/sh $JBOSS_USER -c "sh $JBOSS_HOME/bin/standalone.sh -c appConfig.xml -b 0.0.0.0" 2>&1 > /tmp/jboss7.log &

Thanks, Eric


Eric Wood

unread,
Nov 4, 2014, 1:18:28 PM11/4/14
to jenkins...@googlegroups.com
The appearance is that as long as the process is running, the ssh session will not terminate. It will eventually timeout, but not terminate on it own even when the service command exits with a "0".  If I run the command: 

     service jbossas7.1 stop

while the Jenkins job is still connected and after the service has successfully started, it will terminate the connection and the job will return with a success status.  How do I get the service started and the ssh session to terminate when the service starts.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Richard Bywater

unread,
Nov 4, 2014, 3:13:12 PM11/4/14
to jenkins...@googlegroups.com
Hi Eric

We do this with JBoss EAP and it works fine. We found we had to up the "Exec Timeout" property (under Advanced) as the JBoss start script that we use doesn't return until the app server has started and all the apps deployed have started too (i.e. its "open for business")

Not sure if thats what you are seeing or not but might be worth looking at. I assume that "service jboss7.1 start", if run from a normal command line, will eventually return back to the shell prompt? If not, then that's probably the bigger issue as service commands should really return eventually :)

HTH
Richard.

Eric Wood

unread,
Nov 4, 2014, 3:37:29 PM11/4/14
to jenkins...@googlegroups.com
Richard:

When I run the service from the command line on the actual server, it takes about 30 secs to run and does return to the command line prompt.  If I run the same service from the publish over ssh, it does not seem to return and times out.  I have the time out set to five minutes.  It i stop the process once it is started via the ssh command and then go to the server and kill the process by running a service jboss7.1 stop, the ssh command will terminate and return normally to the jenkins job and indicate success.  What is teh run line you are using to start your service?

Thanks, Eric

Eric Wood

unread,
Nov 4, 2014, 3:51:33 PM11/4/14
to jenkins...@googlegroups.com
An additional note.  I see that they recommend using the provided service script called $JBOSS_HOME/bin/init.d/jboss-as-standalone.sh. We are using some "older" version developed in-house.  I can't see significant differences, but not sure if the way the service is invoked is a factor.
do you use the recommended version of the init.d script mentioned above?

Thanks, Eric

Rob Mandeville

unread,
Nov 4, 2014, 4:07:28 PM11/4/14
to jenkins...@googlegroups.com

I’m not sure if this is relevant, but it may be worth looking at.  The slave considers the job complete when the process exits _and_ STDOUT and STDERR have been closed off.  Since the “service” program is launching JBoss, it may do something stupid like leave stderr open, so that if the server ran into a problem, you’d see it on the prompt that you ran “service” on.

 

Here’s an experiment.  Make the command:

 

service jboss start > /tmp/jboss_start.out 2>&1 && cat /tmp/jboss_start.out

 

One of three things might happen:

 

1: Everything just works, which is great.

2: The job still hangs, and cat is left running, not getting EOF from jboss_start.out because the server is still connected to it.  If you can get away with it, ditch the ‘cat’ command and only look at jboss_start.out by hand if you need to.

3: The job still hangs after cat exits out, which means that my theory is wrong.

 

--Rob

Click here to report this email as spam.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.
Reply all
Reply to author
Forward
0 new messages