minor cleanup and longer wait for windows pipe
This commit is contained in:
parent
3a71298183
commit
eec7bab97a
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,17 +75,20 @@ Launcher.install = function (things, fn) {
|
||||||
|
|
||||||
var killed = 0;
|
var killed = 0;
|
||||||
var err;
|
var err;
|
||||||
var subprocess = spawn(
|
var args = [
|
||||||
vars.telebitNode
|
path.join(telebitRoot, 'bin/telebitd.js')
|
||||||
, [ path.join(telebitRoot, 'bin/telebitd.js')
|
|
||||||
, 'daemon'
|
, 'daemon'
|
||||||
, '--config'
|
, '--config'
|
||||||
, vars.telebitdConfig
|
, vars.telebitdConfig
|
||||||
]
|
];
|
||||||
|
var subprocess = spawn(
|
||||||
|
vars.telebitNode
|
||||||
|
, args
|
||||||
, { 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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue