SSH task Hanging or Disconnecting before completion

I have an SSH task I use after Bamboo deploys Maven .war onto my server, I have used many variations of the following:

sudo nohup service jboss stop &
echo "SLEEPING for 5 seconds during Shutdown of Jboss"
sleep 5
sudo rm -f /usr/share/jboss-as/standalone/deployments/ROOT.war.deployed /usr/share/jboss-as/standalone/deployments/ROOT.war
sudo mv /home/bamboo/ROOT.war /usr/share/jboss-as/standalone/deployments/
sudo nohup service jboss start &
echo "*****SLEEP while JBoss starts: 75 seconds******"
sleep 75
sudo mv /home/bamboo/*.war ../
cd ../

I have also tried exit = 0,

Everything seems to work okay all the way up to starting the server.

Either does not start jboss server and disconnects succesfully or starts the server and does not disconnect?

Any suggestions about how to make the SSH task disconnect after waiting for Jboss to start?

Thank you for your time and diligence.


3 answers

1 accepted

This widget could not be displayed.

I have found a resolution..

I tested that both having a SSH task run a script or putting it in the Script task will not hang bamboo.

/sbin/service jboss restart > /tmp/stderrlogdump 2>&1 &

Apparently dumping stderr releases the terminal from waiting for the process and/or its children to finish.

Thumbs UP!

This widget could not be displayed.

I have a similar problem.

The SSH task never "completes" and just hangs. So my next tasks are never executed.
Were you able to fix your problem?

This widget could not be displayed.

Sorry friend, I have no good news. I'll keep experimenting, please let me know if you find a solution as well.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

78 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you