Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bamboo: Restart TC Server via SSH Task

Andy Norris April 11, 2015

When I run the script from the terminal, ssh'd into my server, stopping and starting TC Server (tcruntime-ctl.sh) works fine. When I launch this script via an SSH task in a Bamboo deployment, I get a 404. Why would the environment be any different? I have checked the paths and the environment variables. Am at a loss.

3 answers

1 accepted

0 votes
Answer accepted
Andy Norris May 8, 2015

The issue was the Aspose.Words.lic license file. I changed how we load the license from pointing to a file on the file system to:

class WordToolService {
License license
  @PostConstruct
  private void init() {

  String licenseString = """
<!--<?xml version="1.0" encoding="utf-8"?>-->
<License>
<Data>..</Data>
<Signature>..</Signature>
</License>
""";
InputStream licenseStream = new ByteArrayInputStream( licenseString.getBytes( "utf-8" ))
license = new License()
license.setLicense(licenseStream)
}
}

 

And now it works.

Thanks,

Andy

0 votes
Andy Norris April 13, 2015

Hi Rafael,

Yes, the user account is the same.

To give some more information, the steps I'm taking in the deployment are:

1) SCP the war file to the web server as the specific user. It does make it to the web server ok.

2) SSH the command to the web server to launch the shell script.

The shell script stops the web server (tcruntime-ctl.sh stop), moves the new war.app to the webapps directory, then starts the web server (tcruntime-ctl.sh start).

If I run this script from the web server, it works fine.

If I run this script from the Bamboo deployment, it does not.

One other thing to note. On another environment, we have a very similar deployment to tomcat v7 that is working fine. 

Thank you very much for your help.

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 13, 2015

Hello Andy,

Thank you for your question.

There are two things that come to my mind based on the scenario provided:

  1. you have mentioned you are able to run the script tcruntime-ctl.sh from Terminal but not from Bamboo. In the Terminal, which user was running the script tcruntime-ctl.sh? Is this user the same one running Bamboo?
  2. by mentioning 404, I am tending to believe you are running the SSH task in a Bamboo deployment that is located on a different box where the command is intended to. Please, open up the build log generated by your deployment and have a look at its second line:

    simple	13-Feb-2015 17:48:25	Build Deployment of 'release-x' on '[ENVIRONMENT]' started building on agent [AGENT-NAME]
    simple	13-Feb-2015 17:48:25	Build working directory is [bammboo-home]/xml-data/build-dir/[project-plan-key]

    Please, go to "Build working directory" above mentioned and attempt to run the same script (tcruntime-ctl.sh) from Terminal.

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events