diff --git a/libraries/networking/src/SandboxUtils.cpp b/libraries/networking/src/SandboxUtils.cpp index c62bd8f982..f6c7634ce5 100644 --- a/libraries/networking/src/SandboxUtils.cpp +++ b/libraries/networking/src/SandboxUtils.cpp @@ -74,8 +74,7 @@ void runLocalSandbox(QString contentPath, bool autoShutdown, bool noUpdater) { if (autoShutdown) { auto pid = qApp->applicationPid(); - qCDebug(networking) << "autoShutdown pid is" << pid; - args << "--watchProcessShutdown" << QString::number(pid); + args << "--shutdownWith" << QString::number(pid); } if (noUpdater) { diff --git a/server-console/src/main.js b/server-console/src/main.js index 55a45a4991..6667a570c8 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -890,18 +890,18 @@ function onContentLoaded() { startInterface(); } - if (argv.watchProcessShutdown) { - let pid = argv.watchProcessShutdown; - console.log("Watching process: ", pid); - let watchProcessInterval = setInterval(function() { + // If we were launched with the shutdownWith option, then we need to shutdown when that process (pid) + // is no longer running. + if (argv.shutdownWith) { + let pid = argv.shutdownWith; + console.log("Shutting down with process: ", pid); + let checkProcessInterval = setInterval(function() { let isRunning = isProcessRunning(pid); if (!isRunning) { log.debug("Watched process is no longer running, shutting down"); - clearTimeout(watchProcessInterval); + clearTimeout(checkProcessInterval); forcedShutdown(); } - }, 5000); - } // If we were launched with the shutdownWatcher option, then we need to watch for the interface app // shutting down. The interface app will regularly update a running state file which we will check.