From eec7bab97a735c307f9d479a7be95cd594e1e893 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 3 Jul 2018 04:12:53 -0600 Subject: [PATCH] minor cleanup and longer wait for windows pipe --- bin/telebitd.js | 2 +- usr/share/install-launcher.js | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/bin/telebitd.js b/bin/telebitd.js index a5933c0..03dfd7e 100755 --- a/bin/telebitd.js +++ b/bin/telebitd.js @@ -588,7 +588,7 @@ function serveControlsHelper() { common.setPort(state.config, address.port); } //console.log(this.address()); - console.info("[info] Listening for commands on " + address); + console.info("[info] Listening for commands on", address); }); } diff --git a/usr/share/install-launcher.js b/usr/share/install-launcher.js index 42d72f4..5c00f3c 100644 --- a/usr/share/install-launcher.js +++ b/usr/share/install-launcher.js @@ -75,17 +75,20 @@ Launcher.install = function (things, fn) { var killed = 0; var err; + var args = [ + path.join(telebitRoot, 'bin/telebitd.js') + , 'daemon' + , '--config' + , vars.telebitdConfig + ]; var subprocess = spawn( vars.telebitNode - , [ path.join(telebitRoot, 'bin/telebitd.js') - , 'daemon' - , '--config' - , vars.telebitdConfig - ] + , args , { detached: true , stdio: [ 'ignore', stdout, stderr ] } ); + //console.log('[debug]', vars.telebitNode, args.join(' ')); subprocess.unref(); subprocess.on('error', function (_err) { err = _err; @@ -98,10 +101,10 @@ Launcher.install = function (things, fn) { // Two things: // 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 () { if (fn) { fn(err); return; } - }, 1.25 * 1000); + }, 1.75 * 1000); return; } , 'launchctl': function () { @@ -283,7 +286,7 @@ Launcher.install = function (things, fn) { // utils.elevate // https://github.com/CatalystCode/windows-registry-node exec('where reg.exe', things._execOpts, function (err, stdout, stderr) { - console.log((stdout||'').trim()); + //console.log((stdout||'').trim()); if (stderr) { console.error(stderr); }