Browse Source

silent errors; remove conf readonly file mode

all-modes
pbca26 7 years ago
parent
commit
f7dfb4b3d0
  1. 9
      main.js
  2. 10
      routes/shepherd.js

9
main.js

@ -116,6 +116,15 @@ process.once('loaded', () => {
}
});
// silent errors
if (!appConfig.debug ||
!appConfig.dev) {
process.on('uncaughtException', (err) => {
shepherd.log(`${(new Date).toUTCString()} uncaughtException: ${err.message}`);
shepherd.log(err.stack);
});
}
guiapp.use(bodyParser.json({ limit: '50mb' })); // support json encoded bodies
guiapp.use(bodyParser.urlencoded({
limit: '50mb',

10
routes/shepherd.js

@ -516,7 +516,7 @@ shepherd.testBins = function(daemonName) {
_fs.access(`${iguanaTestDir}/${daemonName}Test.log`, fs.constants.R_OK, function(err) {
if (!err) {
try {
_fs.unlink(`${iguanaTestDir}/${daemonName}Test.log`);
_fs.unlinkSync(`${iguanaTestDir}/${daemonName}Test.log`);
} catch (e) {}
} else {
shepherd.log(`path ${iguanaTestDir}/${daemonName}Test.log doesnt exist`);
@ -1368,7 +1368,7 @@ shepherd.updateAgama = function() {
status: 'done',
},
});
fs.unlink(`${rootLocation}patch.zip`);
fs.unlinkSync(`${rootLocation}patch.zip`);
} else {
cache.io.emit('patch', {
msg: {
@ -2844,7 +2844,7 @@ function herder(flock, data) {
shepherd.writeLog(`error accessing ${kmdDebugLogLocation}`);
} else {
try {
fs.unlink(kmdDebugLogLocation);
fs.unlinkSync(kmdDebugLogLocation);
shepherd.log(`truncate ${kmdDebugLogLocation}`);
shepherd.writeLog(`truncate ${kmdDebugLogLocation}`);
} catch (e) {
@ -3309,8 +3309,8 @@ function setConf(flock) {
return FixFilePermissions();
})
.then(RemoveLines)
.then(CheckConf)
.then(MakeConfReadOnly);
.then(CheckConf);
// .then(MakeConfReadOnly);
}
function getConf(flock) {

Loading…
Cancel
Save