Fixed MeshCentral Widnows Service exception.

This commit is contained in:
Ylian Saint-Hilaire 2019-07-18 10:42:22 -07:00
parent ead9c95b03
commit fcc45d64ba
2 changed files with 4 additions and 4 deletions

View File

@ -186,7 +186,7 @@ function CreateMeshCentralServer(config, args) {
var child_process = require('child_process'); var child_process = require('child_process');
childProcess = child_process.execFile(process.argv[0], startArgs, { maxBuffer: Infinity, cwd: obj.parentpath }, function (error, stdout, stderr) { childProcess = child_process.execFile(process.argv[0], startArgs, { maxBuffer: Infinity, cwd: obj.parentpath }, function (error, stdout, stderr) {
if (childProcess.xrestart == 1) { if (childProcess.xrestart == 1) {
setTimeout(function () { obj.launchChildServer(startLine); }, 500); // This is an expected restart. setTimeout(function () { obj.launchChildServer(startArgs); }, 500); // This is an expected restart.
} else if (childProcess.xrestart == 2) { } else if (childProcess.xrestart == 2) {
console.log('Expected exit...'); console.log('Expected exit...');
process.exit(); // User CTRL-C exit. process.exit(); // User CTRL-C exit.
@ -219,14 +219,14 @@ function CreateMeshCentralServer(config, args) {
} }
} catch (e) { console.error(e); } } catch (e) { console.error(e); }
} }
setTimeout(function () { obj.launchChildServer(startLine); }, 1000); setTimeout(function () { obj.launchChildServer(startArgs); }, 1000);
}); });
} else { } else {
if (error != null) { if (error != null) {
// This is an un-expected restart // This is an un-expected restart
console.log(error); console.log(error);
console.log('ERROR: MeshCentral failed with critical error, check MeshErrors.txt. Restarting in 5 seconds...'); console.log('ERROR: MeshCentral failed with critical error, check MeshErrors.txt. Restarting in 5 seconds...');
setTimeout(function () { obj.launchChildServer(startLine); }, 5000); setTimeout(function () { obj.launchChildServer(startArgs); }, 5000);
} }
} }
}); });

View File

@ -1,6 +1,6 @@
{ {
"name": "meshcentral", "name": "meshcentral",
"version": "0.3.7-z", "version": "0.3.8-a",
"keywords": [ "keywords": [
"Remote Management", "Remote Management",
"Intel AMT", "Intel AMT",