From 69b411612e567ed4fdfb4d472dcf58075d4484c3 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Wed, 19 Jun 2013 23:14:47 +0200 Subject: [PATCH 1/2] Update dependencies in README --- README | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README b/README index 1cb7659..ae12630 100644 --- a/README +++ b/README @@ -24,3 +24,8 @@ repository root | |- locales/ Contains all CPHP locale files | `- templates/ Contains all CPHP template files `- runhelper/ This directory contains the runhelper script for the slave nodes + +== DEPENDENCIES == + +* autossh +* ... From 5b74eb8af8b25eeafd41b68d352410a7356a2410 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 20 Jun 2013 00:05:56 +0200 Subject: [PATCH 2/2] Fix some issues related to SSH timeouts --- frontend/classes/sshconnector.php | 4 +++- frontend/classes/vps.php | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/classes/sshconnector.php b/frontend/classes/sshconnector.php index 95ae3c7..874620f 100644 --- a/frontend/classes/sshconnector.php +++ b/frontend/classes/sshconnector.php @@ -236,11 +236,13 @@ class SshConnector extends CPHPBaseClass $cmd = urlencode(json_encode($command)); $url = "http://localhost:{$this->tunnel_port}/?key={$this->tunnel_key}&command={$cmd}"; + /* Setting a HTTP timeout is going to break long-running requests. + * What the hell was I thinking?! $context = stream_context_create(array( 'http' => array( 'timeout' => 2.0 ) - )); + ));*/ $response = @file($url, 0, $context); diff --git a/frontend/classes/vps.php b/frontend/classes/vps.php index d842255..2e074be 100644 --- a/frontend/classes/vps.php +++ b/frontend/classes/vps.php @@ -314,7 +314,6 @@ class Vps extends CPHPDatabaseRecordClass $command = array("sudo", "vzctl", "create", $this->sInternalId, "--ostemplate", $this->sTemplate->sTemplateName); $result = $this->sNode->ssh->RunCommand($command, false); - $result->returncode = 0; if($result->returncode == 0 && strpos($result->stderr, "ERROR") === false) {