Quellcode durchsuchen

slaby debug exec - nie widac co nie dziala - a jest zmiana ssl keya : sudo -u _www ssh server@bocian-energa.procesy5.pl 'ls -1' - warto to ogarnac jakims ignore
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

a.binder vor 8 Jahren
Ursprung
Commit
8c2d8eab08
1 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen
  1. 6 2
      SE/se-lib/Route/Install.php

+ 6 - 2
SE/se-lib/Route/Install.php

@@ -794,9 +794,13 @@ chmod 600 ~/.ssh/authorized_keys;
 		//$cmd = "ssh -i ~/.ssh/id_rsa server@{$appLicenceInfo->mainServer} 'ls -1'";
 		$sshPort = (22 != $appLicenceInfo->sshPort)? "-p {$appLicenceInfo->sshPort}" : '';
 		$cmd = "ssh {$sshPort} {$appLicenceInfo->rootLogin}@{$appLicenceInfo->mainServer} 'ls -1'";
-		V::exec($cmd, $out, $ret);
+		V::exec("$cmd 2>&1", $out, $ret); // http://php.net/manual/pl/function.exec.php says I saw the exec, system, shell_exec and passthru functions, 
+				//and deduced that the solution was to 
+				//redirect the standard error (stderr) to the standard output (stdout). It's not very clean, since it mixes stderr with stdout, and I only wanted to log the stderr. 
+				//But it seems to be the only solution (suggestions are welcome). 
+
 		DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
-		if (0 !== $ret) throw new Exception("Cannot run remote command using rsa key! #{$ret}. Cmd: {$cmd}");
+		if (0 !== $ret) throw new Exception("Cannot run remote command using rsa key! #{$ret}; Out: {$out}; Cmd: {$cmd};");
 	}