-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,16 +117,22 @@ private function parseExitStatus(Process $process) | |
return $exitCode; | ||
} | ||
|
||
private function initMultiplexing(Host $host) : Arguments | ||
private function initMultiplexing(Host $host) | ||
{ | ||
$sshArguments = $host->getSshArguments()->withMultiplexing($host); | ||
$controlPath = $sshArguments->getOption('ControlPath'); | ||
|
||
$process = new Process("ssh $sshArguments -O check -S $controlPath $host 2>&1"); | ||
$process = new Process("ssh -O check $sshArguments $host 2>&1"); | ||
$process->run(); | ||
|
||
if (!preg_match('/Master running/', $process->getOutput()) && $this->output->isVeryVerbose()) { | ||
$this->pop->writeln(Process::OUT, $host->getHostname(), 'ssh multiplexing initialization'); | ||
|
||
// Open master connection explicit, | ||
// ControlMaster=auto could not working | ||
(new Process("ssh -M $sshArguments $host"))->start(); | ||
|
||
// Delay to wait connection established | ||
sleep(1); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
antonmedv
Author
Member
|
||
} | ||
|
||
return $sshArguments; | ||
|
Process->run() is synchronous. we dont need the sleep when using run instead of start