sudo: remove the nice support

This commit is contained in:
Girish Ramakrishnan
2020-08-06 16:44:35 -07:00
parent ac63d00c93
commit 2112c7d096
3 changed files with 1 additions and 8 deletions
+1 -1
View File
@@ -856,7 +856,7 @@ function runBackupUpload(uploadConfig, progressCallback, callback) {
let result = ''; // the script communicates error result as a string
shell.sudo(`backup-${backupId}`, [ BACKUP_UPLOAD_CMD, backupId, format, dataLayout.toString() ], { preserveEnv: true, ipc: true, nice: 15 }, function (error) {
shell.sudo(`backup-${backupId}`, [ BACKUP_UPLOAD_CMD, backupId, format, dataLayout.toString() ], { preserveEnv: true, ipc: true }, function (error) {
if (error && (error.code === null /* signal */ || (error.code !== 0 && error.code !== 50))) { // backuptask crashed
return callback(new BoxError(BoxError.INTERNAL_ERROR, 'Backuptask crashed'));
} else if (error && error.code === 50) { // exited with error
-6
View File
@@ -14,7 +14,6 @@ var assert = require('assert'),
util = require('util');
const SUDO = '/usr/bin/sudo';
const NICE = '/usr/bin/nice';
function exec(tag, cmd, callback) {
assert.strictEqual(typeof tag, 'string');
@@ -42,11 +41,6 @@ function spawn(tag, file, args, options, callback) {
if (options.ipc) options.stdio = ['pipe', 'pipe', 'pipe', 'ipc'];
if (options.nice) {
args = ['-n', options.nice, file].concat(args);
file = NICE;
}
debug(tag + ' spawn: %s %s', file, args.join(' '));
const cp = child_process.spawn(file, args, options);
-1
View File
@@ -40,7 +40,6 @@ exports = module.exports = {
let assert = require('assert'),
async = require('async'),
BoxError = require('./boxerror.js'),
child_process = require('child_process'),
debug = require('debug')('box:tasks'),
path = require('path'),
paths = require('./paths.js'),