minor cleanup and longer wait for windows pipe

This commit is contained in:
AJ ONeal 2018-07-03 04:12:53 -06:00
parent 3a71298183
commit eec7bab97a
2 changed files with 12 additions and 9 deletions

View File

@ -588,7 +588,7 @@ function serveControlsHelper() {
common.setPort(state.config, address.port); common.setPort(state.config, address.port);
} }
//console.log(this.address()); //console.log(this.address());
console.info("[info] Listening for commands on " + address); console.info("[info] Listening for commands on", address);
}); });
} }

View File

@ -75,17 +75,20 @@ Launcher.install = function (things, fn) {
var killed = 0; var killed = 0;
var err; var err;
var args = [
path.join(telebitRoot, 'bin/telebitd.js')
, 'daemon'
, '--config'
, vars.telebitdConfig
];
var subprocess = spawn( var subprocess = spawn(
vars.telebitNode vars.telebitNode
, [ path.join(telebitRoot, 'bin/telebitd.js') , args
, 'daemon'
, '--config'
, vars.telebitdConfig
]
, { detached: true , { detached: true
, stdio: [ 'ignore', stdout, stderr ] , stdio: [ 'ignore', stdout, stderr ]
} }
); );
//console.log('[debug]', vars.telebitNode, args.join(' '));
subprocess.unref(); subprocess.unref();
subprocess.on('error', function (_err) { subprocess.on('error', function (_err) {
err = _err; err = _err;
@ -98,10 +101,10 @@ Launcher.install = function (things, fn) {
// Two things: // Two things:
// 1) wait to see if the process dies // 1) wait to see if the process dies
// 2) wait to give time for the socket to cennect // 2) wait to give time for the socket to connect
setTimeout(function () { setTimeout(function () {
if (fn) { fn(err); return; } if (fn) { fn(err); return; }
}, 1.25 * 1000); }, 1.75 * 1000);
return; return;
} }
, 'launchctl': function () { , 'launchctl': function () {
@ -283,7 +286,7 @@ Launcher.install = function (things, fn) {
// utils.elevate // utils.elevate
// https://github.com/CatalystCode/windows-registry-node // https://github.com/CatalystCode/windows-registry-node
exec('where reg.exe', things._execOpts, function (err, stdout, stderr) { exec('where reg.exe', things._execOpts, function (err, stdout, stderr) {
console.log((stdout||'').trim()); //console.log((stdout||'').trim());
if (stderr) { if (stderr) {
console.error(stderr); console.error(stderr);
} }