Skip to content

Commit

Permalink
Fix java download/install
Browse files Browse the repository at this point in the history
The configurable tmpdir broke automatic java download and install because it omitted a slash between /tmp and the jdk name.  The result was permission denied:

```
Creating tmp directory (/tmp) if it does not exist
Verifying that java exists
bash: java: command not found
Installing Java
/tmpjava1.6.0_12.tgz: Permission denied
Failed to download Java
```
  • Loading branch information
alamaison committed Apr 13, 2015
1 parent c4abeb7 commit 37d66c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ else if (bootstrapResult == SAMEUSER) {
String path = "/hudson-ci/jdk/linux-i586/" + jdk + ".tgz";

URL url = computer.getCloud().buildPresignedURL(path);
if(conn.exec("wget -nv -O " + tmpDir + jdk + ".tgz '" + url + "'", logger) !=0) {
if(conn.exec("wget -nv -O " + tmpDir + "/" + jdk + ".tgz '" + url + "'", logger) !=0) {
logger.println("Failed to download Java");
return;
}

if(conn.exec(buildUpCommand(computer, "tar xz -C /usr -f " + tmpDir + jdk + ".tgz"), logger) !=0) {
if(conn.exec(buildUpCommand(computer, "tar xz -C /usr -f " + tmpDir + "/" + jdk + ".tgz"), logger) !=0) {
logger.println("Failed to install Java");
return;
}
Expand Down

0 comments on commit 37d66c7

Please sign in to comment.