Fixed issue in \ncc\Managers > ExecutionPointerManager > executeUnit()
where if ttyMode is enabled in a non-tty environment, the process will throw an exception "/etc/ncc/ThirdParty/Symfony/Process/Process.php:1019 Error: TTY mode requires /dev/tty to be read/writable.", now ncc will display a warning if TTY mode cannot be enabled
This commit is contained in:
parent
277a09529e
commit
05b46296d7
2 changed files with 29 additions and 12 deletions
|
@ -400,26 +400,37 @@
|
|||
$process->setTimeout(null);
|
||||
}
|
||||
|
||||
if($unit->ExecutionPolicy->Execute->Silent)
|
||||
try
|
||||
{
|
||||
$process->disableOutput();
|
||||
$process->setTty(false);
|
||||
if($unit->ExecutionPolicy->Execute->Silent)
|
||||
{
|
||||
$process->disableOutput();
|
||||
$process->setTty(false);
|
||||
}
|
||||
elseif($unit->ExecutionPolicy->Execute->Tty)
|
||||
{
|
||||
$process->enableOutput();
|
||||
$process->setTty(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$process->enableOutput();
|
||||
}
|
||||
}
|
||||
elseif($unit->ExecutionPolicy->Execute->Tty)
|
||||
catch(Exception $e)
|
||||
{
|
||||
$process->enableOutput();
|
||||
$process->setTty(true);
|
||||
Console::outWarning('The process is configured to use a TTY, but the current environment does not support it');
|
||||
}
|
||||
else
|
||||
finally
|
||||
{
|
||||
$process->enableOutput();
|
||||
if($process->isTty() && !Functions::isTtyMode())
|
||||
{
|
||||
Console::outWarning('The process is configured to use a TTY, but the current environment does not support it');
|
||||
$process->setTty(false);
|
||||
}
|
||||
}
|
||||
|
||||
if($process->isTty() && !Functions::isTtyMode())
|
||||
{
|
||||
Console::outWarning('The process is configured to use a TTY, but the current environment does not support it');
|
||||
$process->setTty(false);
|
||||
}
|
||||
|
||||
Console::outDebug(sprintf('working_directory=%s', $process->getWorkingDirectory()));
|
||||
Console::outDebug(sprintf('timeout=%s', ($process->getTimeout() ?? 0)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue