Fix remote nginx always showing Stopped — SSH warning poisoned isRunning()

remoteExec uses 2>&1 so SSH's own stderr merged with command stdout.
The 'Warning: Permanently added...' line prepended to 'active' made the
=== 'active' check in isRunning() always return false.

Add -o LogLevel=ERROR to suppress SSH informational/warning messages
while keeping actual remote command output and real SSH errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 12:55:33 +00:00
parent 5e75d4cae4
commit 120449a40a
+1 -1
View File
@@ -80,7 +80,7 @@ class ProxyManager {
if (!$r['host']) return 'no remote host configured'; if (!$r['host']) return 'no remote host configured';
return shell_exec( return shell_exec(
'sshpass -p ' . escapeshellarg($r['pass']) . 'sshpass -p ' . escapeshellarg($r['pass']) .
' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 ' . ' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 -o LogLevel=ERROR ' .
escapeshellarg($r['user'] . '@' . $r['host']) . ' ' . escapeshellarg($r['user'] . '@' . $r['host']) . ' ' .
escapeshellarg($cmd) . ' 2>&1' escapeshellarg($cmd) . ' 2>&1'
) ?? ''; ) ?? '';