Skip to content

Commit

Permalink
Update logman.js
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Jan 7, 2024
1 parent d3748f2 commit 6ee9b30
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/executor/logman.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,19 @@ class LogmanExecutor {
"tail", "-n", n, domain['Error log']]);
case 'passenger':
const user = domain['Username'];
const pe = process.env.NODE_ENV === 'development' ?
{ stdout: await readFile('./test/passenger-status', {encoding: 'utf-8'}) } :
await spawnSudoUtil("SHELL_SUDO", [user,
"passenger-status", "--show=xml"]);
const peo = pe.stdout.trim();
let peo;
try {
const pe = process.env.NODE_ENV === 'development' ?
{ stdout: await readFile('./test/passenger-status', { encoding: 'utf-8' }) } :
await spawnSudoUtil("SHELL_SUDO", [user,
"passenger-status", "--show=xml"]);
peo = pe.stdout.trim();
} catch (error) {
}
if (!peo) {
return {
code: 255,
stderr: 'Passenger instance is not set here',
stderr: 'No passenger app is found or it\'s not initialized yet',
}
}
const parser = new XMLParser();
Expand Down

0 comments on commit 6ee9b30

Please sign in to comment.