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.json({ limit: '50mb' })); // support json encoded bodies
guiapp.use(bodyParser.urlencoded({ guiapp.use(bodyParser.urlencoded({
limit: '50mb', 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) { _fs.access(`${iguanaTestDir}/${daemonName}Test.log`, fs.constants.R_OK, function(err) {
if (!err) { if (!err) {
try { try {
_fs.unlink(`${iguanaTestDir}/${daemonName}Test.log`); _fs.unlinkSync(`${iguanaTestDir}/${daemonName}Test.log`);
} catch (e) {} } catch (e) {}
} else { } else {
shepherd.log(`path ${iguanaTestDir}/${daemonName}Test.log doesnt exist`); shepherd.log(`path ${iguanaTestDir}/${daemonName}Test.log doesnt exist`);
@ -1368,7 +1368,7 @@ shepherd.updateAgama = function() {
status: 'done', status: 'done',
}, },
}); });
fs.unlink(`${rootLocation}patch.zip`); fs.unlinkSync(`${rootLocation}patch.zip`);
} else { } else {
cache.io.emit('patch', { cache.io.emit('patch', {
msg: { msg: {
@ -2844,7 +2844,7 @@ function herder(flock, data) {
shepherd.writeLog(`error accessing ${kmdDebugLogLocation}`); shepherd.writeLog(`error accessing ${kmdDebugLogLocation}`);
} else { } else {
try { try {
fs.unlink(kmdDebugLogLocation); fs.unlinkSync(kmdDebugLogLocation);
shepherd.log(`truncate ${kmdDebugLogLocation}`); shepherd.log(`truncate ${kmdDebugLogLocation}`);
shepherd.writeLog(`truncate ${kmdDebugLogLocation}`); shepherd.writeLog(`truncate ${kmdDebugLogLocation}`);
} catch (e) { } catch (e) {
@ -3309,8 +3309,8 @@ function setConf(flock) {
return FixFilePermissions(); return FixFilePermissions();
}) })
.then(RemoveLines) .then(RemoveLines)
.then(CheckConf) .then(CheckConf);
.then(MakeConfReadOnly); // .then(MakeConfReadOnly);
} }
function getConf(flock) { function getConf(flock) {

Loading…
Cancel
Save