From 22099a14a867fa5235449c543b95ec71344f649d Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 29 Jun 2017 13:50:40 -0700 Subject: [PATCH] Go Home spawns interface detached --- server-console/src/main.js | 8 +++++--- server-console/src/modules/hf-process.js | 11 ++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index b99d1387b5..efa04a8512 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -334,6 +334,7 @@ function startInterface(url) { // create a new Interface instance - Interface makes sure only one is running at a time var pInterface = new Process('interface', interfacePath, argArray); + pInterface.detached = true; pInterface.start(); } @@ -894,15 +895,16 @@ function onContentLoaded() { if (dsPath && acPath) { var dsArguments = ['--get-temp-name', '--parent-pid', process.pid]; - domainServer = new Process('domain-server', dsPath, dsArguments, - logPath, true); + domainServer = new Process('domain-server', dsPath, dsArguments, logPath); + domainServer.restartOnCrash = true; var acArguments = ['-n7', '--log-directory', logPath, '--http-status-port', httpStatusPort, '--parent-pid', process.pid]; acMonitor = new ACMonitorProcess('ac-monitor', acPath, acArguments, - httpStatusPort, logPath, true); + httpStatusPort, logPath); + acMonitor.restartOnCrash = true; homeServer = new ProcessGroup('home', [domainServer, acMonitor]); logWindow = new LogWindow(acMonitor, domainServer); diff --git a/server-console/src/modules/hf-process.js b/server-console/src/modules/hf-process.js index af728eeda7..b75835c06f 100644 --- a/server-console/src/modules/hf-process.js +++ b/server-console/src/modules/hf-process.js @@ -102,7 +102,7 @@ ProcessGroup.prototype = extend(ProcessGroup.prototype, { }); var ID = 0; -function Process(name, command, commandArgs, logDirectory, restartOnCrash) { +function Process(name, command, commandArgs, logDirectory) { events.EventEmitter.call(this); this.id = ++ID; @@ -113,7 +113,8 @@ function Process(name, command, commandArgs, logDirectory, restartOnCrash) { this.logDirectory = logDirectory; this.logStdout = null; this.logStderr = null; - this.restartOnCrash = restartOnCrash; + this.detached = false; + this.restartOnCrash = false; this.state = ProcessStates.STOPPED; }; @@ -166,7 +167,7 @@ Process.prototype = extend(Process.prototype, { try { this.child = childProcess.spawn(this.command, this.commandArgs, { - detached: false, + detached: this.detached, stdio: ['ignore', logStdout, logStderr] }); log.debug("Spawned " + this.command + " with pid " + this.child.pid); @@ -283,8 +284,8 @@ Process.prototype = extend(Process.prototype, { // ACMonitorProcess is an extension of Process that keeps track of the AC Montior's // children status and log locations. const CHECK_AC_STATUS_INTERVAL = 1000; -function ACMonitorProcess(name, path, args, httpStatusPort, logPath, restartOnCrash) { - Process.call(this, name, path, args, logPath, restartOnCrash); +function ACMonitorProcess(name, path, args, httpStatusPort, logPath) { + Process.call(this, name, path, args, logPath); this.httpStatusPort = httpStatusPort;