From 37d66c7107b6612025f382bd9b551ed8b1f3da03 Mon Sep 17 00:00:00 2001 From: Alexander Lamaison Date: Mon, 13 Apr 2015 15:54:19 +0100 Subject: [PATCH] Fix java download/install 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 ``` --- src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java b/src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java index 20570daae..056032174 100644 --- a/src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java +++ b/src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java @@ -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; }