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
./DeployPrep.sh
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 ../
exit
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.
Cheers!