Add option to not log shell subprocess stdout+stderr

When tailing the box log file this leads to logline recursion
This commit is contained in:
Johannes Zellner
2024-07-25 10:21:57 +02:00
parent 8d9043e590
commit 51bb2d2bc2
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ function tail(filePaths, options) {
const args = [ LOGTAIL_CMD, '--lines=' + lines ];
if (options.follow) args.push('--follow');
return shell.sudo('tail', args.concat(filePaths), { streamStdout: true }, () => {});
return shell.sudo('tail', args.concat(filePaths), { streamStdout: true, dropStdout: true, dropStdErr: true }, () => {});
}
function journalctl(unit, options) {
+2 -2
View File
@@ -111,10 +111,10 @@ function sudo(tag, args, options, callback) {
cp.stdout.on('data', (data) => {
if (options.captureStdout) stdoutResult += data.toString('utf8');
process.stdout.write(data); // do not use debug to avoid double timestamps when calling backupupload.js
if (!options.dropStdout) process.stdout.write(data); // do not use debug to avoid double timestamps when calling backupupload.js
});
cp.stderr.on('data', (data) => {
process.stderr.write(data); // do not use debug to avoid double timestamps when calling backupupload.js
if (!options.dropStderr) process.stderr.write(data); // do not use debug to avoid double timestamps when calling backupupload.js
});
cp.on('exit', function (code, signal) {