Handler for the SIGHUP (reload config) signal in master process
@return void
519298
protected function sighup()
    {
        if (Daemon::$config->logsignals->value) {
            $this->log('Caught SIGHUP (reload config).');
        }

        if (isset(Daemon::$config->configfile)) {
            Daemon::loadConfig(Daemon::$config->configfile->value);
        }

        $this->signalToChildren(SIGHUP);
    }
683615
protected function breakMainLoopCheck()
    {
        $time = microtime(true);

        if ($this->terminated || $this->breakMainLoop) {
            EventLoop::$instance->stop();
            return;
        }

        if ($this->shutdown) {
            EventLoop::$instance->stop();
            return;
        }

        if ($this->reload) {
            return;
        }

        if (Daemon::$config->maxmemoryusage->value > 0
            && (memory_get_usage(true) > Daemon::$config->maxmemoryusage->value)
        ) {
            $this->log('\'maxmemory\' exceed. Graceful shutdown.');

            $this->gracefulRestart();
        }

        if (Daemon::$config->maxrequests->value > 0
            && ($this->reqCounter >= Daemon::$config->maxrequests->value)
        ) {
            $this->log('\'max-requests\' exceed. Graceful shutdown.');

            $this->gracefulRestart();
        }

        if (Daemon::$config->maxidle->value
            && $this->timeLastActivity && ($time - $this->timeLastActivity > Daemon::$config->maxidle->value)
        ) {
            $this->log('\'maxworkeridle\' exceed. Graceful shutdown.');

            $this->gracefulRestart();
        }

        if ($this->update === true) {
            $this->update = false;
            $this->update();
        }
    }
411445
function onShutdown(): void
    {
        // free the reserved memory
        $this->reservedMemory = null;

        if (
            $this->isActive()
            && ($error = error_get_last()) !== null
            && $error !== $this->lastError
        ) {
            $this->lastError = null;

            // fix working directory
            if ($this->workingDirectory !== null) {
                chdir($this->workingDirectory);
            }

            // determine exception class
            if ($this->isOutOfMemoryError($error)) {
                gc_collect_cycles();
                $exceptionClass = OutOfMemoryException::class;
            } else {
                $exceptionClass = FatalErrorException::class;
            }

            // handle
            $this->onUncaughtException(
                new $exceptionClass(
                    $error['message'],
                    0,
                    $error['type'],
                    $error['file'],
                    $error['line'],
                    $this->currentErrorException // use current error exception if a fatal error happens during onError()
                )
            );
        }
    }
390020
public function onConfigUpdated()
    {
        if (Daemon::$process instanceof Thread\Worker) {
            if ($this->config === null) {
                $this->disable();
            } else {
                $this->enable();
            }
        }
        if ($defaults = $this->getConfigDefaults()) {
            $this->config->imposeDefault($defaults);
        }
        $this->applyConfig();
    }
225759
protected function sigint()
    {
        if (Daemon::$config->logsignals->value) {
            $this->log('caught SIGINT.');
        }

        $this->shutdown(true);
    }
1117763
public function reload()
    {
        $server = $this->createServerManager();

        if (!$server->isRunning()) {
            \output()->writeln('<error>The server is not running! cannot reload</error>', true, true);
        }

        \output()->writeln(sprintf('<info>Server %s is reloading</info>', input()->getScript()));

        $reloadTask = input()->hasOpt('t');
        $server->reload($reloadTask);
        \output()->writeln(sprintf('<success>Server %s reload success</success>', input()->getScript()));
    }
678608
def process_signal(self, signum):
        
        if signum == signal.SIGTERM:
            LOGGER.info('Received SIGTERM, initiating shutdown')
            self.stop()
        elif signum == signal.SIGHUP:
            LOGGER.info('Received SIGHUP')
            if self.config.reload():
                LOGGER.info('Configuration reloaded')
                logging.config.dictConfig(self.config.logging)
                self.on_configuration_reloaded()
        elif signum == signal.SIGUSR1:
            self.on_sigusr1()
        elif signum == signal.SIGUSR2:
            self.on_sigusr2()
1082188
public function reload()
    {
        if ($this->presenter->isAjax()) {
            $this->presenter->payload->grido = TRUE;
            $this->redrawControl();
        } else {
            $this->redirect('this');
        }
    }
485924
public function handleLogOut(): void
	{
		$this->user->logout();
		$this->flashNotifier->info('cms.user.youAreLoggedOut');
		$this->presenter->redirect(":{$this->module}:Sign:in");
	}
1181056
protected function processMasterSocket(): void
    {
        $new = null;

        try {
            $new = $this->socket->accept();
        } catch (Exception $e) {
            $this->logger->error('Socket error: {exception}', [
                'exception' => $e,
            ]);
            return;
        }

        $connection = $this->createConnection($new);
        $this->server->notify(Server::EVENT_SOCKET_CONNECT, [$new, $connection]);
    }
1154156
public function handleShutdown()
    {
        if (!is_null($error = error_get_last()) && $this->isFatal($error['type'])) {
            $this->handleException($this->fatalExceptionFromError($error, 0));
        }
        $this->getExceptionHandler()->shutdown();
    }
761006
public function reload()
    {
        if ($this['object'] === 'event') {
            parent::g_reload(self::getUrl($this['id']));
        } else {
            parent::g_reload(self::getUrl());
        }
    }
271015
protected function registerShutdownHandlers()
    {
        $self = $this;
        register_shutdown_function(function () use ($self) {
            if (($error = error_get_last()) && in_array($error['type'], array(E_PARSE, E_ERROR, E_USER_ERROR))) {
                $self->shutdown(1, $error);
            } else {
                $self->emit('finish', 0);
                $self->shutdown();
            }

            if (!is_resource($self->queue) || !msg_stat_queue($self->queue)) {
                return;
            }

            msg_remove_queue($self->queue);
        });
    }
532589
function setupHandlers() {

    function terminate(err) {
        util.log('Uncaught Error: ' + err.message);
        console.log(err.stack);
        if (proc.shutdownHook) {
            proc.shutdownHook(err, gracefulShutdown);
        }
    }

    process.on('uncaughtException', terminate);

    process.addListener('SIGINT', gracefulShutdown);

    process.addListener('SIGHUP', function () {
        util.log('RECIEVED SIGHUP signal, reloading log files...');
        reload(argv);
    });

}
254048
protected function signalHandler($signo)
    {
        //accept signal once
        if ($this->signo === null) {
            switch ($signo) {
                //terminate
                case SIGTERM:
                case SIGINT:
                    $this->signo = $signo;
                    break;
                //restart
                case SIGHUP:
                    $this->signo = $signo;
                    register_shutdown_function(function () {
                        pcntl_exec($this->fullName[0], array_slice($this->fullName, 1));
                    });
                    break;
                //the others just ignore
                default:
                    break;
            }
        }
    }
151684
public function handleDeploy(): void
	{
		$this->checkHandlerPermission();

		try {
			$this->app->gitPull(true);
			$this->app->clearCache();
			$this->flashNotifier->success('dockbar.management.source.deployed');
		} catch (\InvalidArgumentException $ex) {
			$this->flashNotifier->error('dockbar.management.source.deployNotSet');
		}
	}
483622
protected function handleSignals(): void
    {
        foreach ([SIGTERM, SIGQUIT, SIGABRT, SIGINT] as $signal) {
            pcntl_signal($signal, function ($signal) {
                $this->terminate($signal);
            });
        }
    }