(Internal) Exits the ISNode Process
11498
function() {
		var currentDate = new Date();
		currentDate = currentDate.toISOString();
		console.log(currentDate + " (shutdown) Shutdown Complete");
		process.exit();
	}
776199
def terminate(pid, sig, timeout):
    ''''''
    os.kill(pid, sig)
    start = time.time()
    while True:
        try:
            # This is requireed if it's our child to avoid zombie. Also
            # is_running() returns True for zombie process.
            _, status = os.waitpid(pid, os.WNOHANG)
        except OSError as exc:
            if exc.errno != errno.ECHILD: # pragma: nocover
                raise
        else:
            if status:
                return True
        if not is_running(pid):
            return True
        if time.time()-start>=timeout:
            return False
        time.sleep(0.1)
911186
def running(processid):
    
    try:
        # From kill(2)
        #   If sig is 0 (the null signal), error checking is performed but no
        #   signal is actually sent. The null signal can be used to check the
        #   validity of pid
        os.kill(processid, 0)
    except OverflowError as exc:
        print("checking validity of pid ({p}) failed with: {e}"
              .format(p=processid, e=exc))
        sys.exit(1)
    except OSError:
        return False
    else:
        return True
928396
function immediateExit(exitCode) {
    electron.removeListener('exit', immediateExit);
    electron.removeListener('error', immediateError);

    callback(new NavitError(`Electron immediately exited with: ${exitCode}`));
  }
353362
private void safetyExit(Process process) throws IOException {
        process.getErrorStream().close();
        process.getInputStream().close();
        process.getOutputStream().close();
    }
382477
function abort(options = {}) {
    if (process.platform !== 'win32' && process.platform !== 'linux') {
        throw new Error('Unsupported OS (only Windows and Linux are supported)!');
    }

    let cmdarguments = ['shutdown'];
    
    if (process.platform === 'win32') {
        cmdarguments.push('-a'); // abort
    } else {
        // linux
        cmdarguments.push('-c'); // cancel a pending shutdown
    }
    
    executeCmd(cmdarguments, options.debug, options.quitapp);
}
404824
function () {
  var args = Array.prototype.slice.call(arguments);
  console.error();
  console.error.apply(console, [" "].concat(args));
  console.error();
  process.exit(1); // eslint-disable-line no-process-exit
}
1199406
def _close_stdio():
    """"""
    for fd in (sys.stdin, sys.stdout, sys.stderr):
      file_no = fd.fileno()
      fd.flush()
      fd.close()
      os.close(file_no)
1079468
function cleanUpOldExecutable(next) {
        fs.unlink(nodeCompiler.releasePath, function(err) {
          if (err) {
            if (err.code === 'ENOENT') {
              next();
            } else {
              throw err;
            }
          } else {
            next();
          }
        });
      }
976349
def __exitfunction(self):
        '''
        
        '''
        if self._hook.exit_code is None and self._hook.exception is None:
            print("Check did not exit! You should call an exit code method.")
            sys.stdout.flush()
            os._exit(1)
        elif self._hook.exception:
            print("Check failed to run: %s, %s" %
                  (sys.last_type, traceback.format_tb(sys.last_traceback)))
            sys.stdout.flush()
            os._exit(2)
1294950
private void exit() {
        if (exitAction != null) {
            SwingUtilities.invokeLater(exitAction);
        }
        dim.setReturnValue(Dim.EXIT);
    }
871049
public final void exit(Class sourceClass,
                           String methodName) {
        internalExit(null,
                     sourceClass,
                     methodName,
                     null);
    }
32115
function handleExit (canCancel, signal, code) {
	var i = 0,
		sub;

	while ((sub = subs[i++])) {
		if (sub[0].call(sub[1], canCancel, signal, code) === false && canCancel) {
			return;
		}
	}

	if (canCancel) {
		process.exit(code);
	}
}
601214
function(){
		if(shuttingDown == true)
			return;
		modules.logger.log("startup","ISNode System > Loading Critical Modules...");
		var notLoadedString = "";
		loadModule("isnode-mod-utilities");
		if(!modules.utilities)
			notLoadedString += "utilities, ";
		if(notLoadedString != ""){
			notLoadedString = notLoadedString.substring(0, notLoadedString.length - 2);
			modules.logger.log("fatal","ISNode System > Unable to load critical isnode modules - " + notLoadedString + ". Exiting isnode.");
			process.exit();
			return false;
		}
		return true;
	}
464604
static void exit(int status) {
        boolean runMoreFinalizers = false;
        synchronized (lock) {
            if (status != 0) runFinalizersOnExit = false;
            switch (state) {
            case RUNNING:       /* Initiate shutdown */
                state = HOOKS;
                break;
            case HOOKS:         /* Stall and halt */
                break;
            case FINALIZERS:
                if (status != 0) {
                    /* Halt immediately on nonzero status */
                    halt(status);
                } else {
                    /* Compatibility with old behavior:
                     * Run more finalizers and then halt
                     */
                    runMoreFinalizers = runFinalizersOnExit;
                }
                break;
            }
        }
        if (runMoreFinalizers) {
            runAllFinalizers();
            halt(status);
        }
        synchronized (Shutdown.class) {
            /* Synchronize on the class object, causing any other thread
             * that attempts to initiate shutdown to stall indefinitely
             */
            sequence();
            halt(status);
        }
    }
1365671
function(isnodeObj){
		if(initialised)
			return ismod;
		isnode = isnodeObj;
		log = isnode.module("logger").log;
		if(config.router.instances) {
			var count = 0;
			for(var instance in config.router.instances){
				if(config.router.instances[instance].services && config.router.instances[instance].interfaces) {
					makeRouter(instance);
					routerCount ++;
				} else {
					log("fatal", "One or more routers are misconfigured. Terminating application server...");
					isnode.shutdown();					
				}
			}
		} else {
			log("fatal", "No routers configured. Terminating application server...");
			isnode.shutdown();
		}
		isnode.on("shutdown", function(){ shutdown(); });
		initialised = true;
		return ismod;
	}
716838
@VisibleForTesting
  void exitIdleMode() {
    syncContext.throwIfNotInThisSynchronizationContext();
    if (shutdown.get() || panicMode) {
      return;
    }
    if (inUseStateAggregator.isInUse()) {
      // Cancel the timer now, so that a racing due timer will not put Channel on idleness
      // when the caller of exitIdleMode() is about to use the returned loadBalancer.
      cancelIdleTimer(false);
    } else {
      // exitIdleMode() may be called outside of inUseStateAggregator.handleNotInUse() while
      // isInUse() == false, in which case we still need to schedule the timer.
      rescheduleIdleTimer();
    }
    if (lbHelper != null) {
      return;
    }
    channelLogger.log(ChannelLogLevel.INFO, "Exiting idle mode");
    LbHelperImpl lbHelper = new LbHelperImpl();
    lbHelper.lb = loadBalancerFactory.newLoadBalancer(lbHelper);
    // Delay setting lbHelper until fully initialized, since loadBalancerFactory is user code and
    // may throw. We don't want to confuse our state, even if we will enter panic mode.
    this.lbHelper = lbHelper;

    NameResolverObserver observer = new NameResolverObserver(lbHelper, nameResolver);
    nameResolver.start(observer);
    nameResolverStarted = true;
  }