Exemplo n.º 1
0
void
sig_handlers::sig_term (ev::sig &w, int revents)
{
  rxvt_emergency_cleanup ();
  w.stop ();
  kill (getpid (), w.signum);
}
Exemplo n.º 2
0
	~MyServer()
	{
		if (sigterm_.is_active()) {
			ev_ref(loop_);
			sigterm_.stop();
		}
	}
Exemplo n.º 3
0
	void terminate_handler(ev::sig& sig, int)
	{
		std::clog << "Terminate signal received ..." << std::endl;

		ev_ref(loop_);
		sig.stop();

		http_->stop();
	}
Exemplo n.º 4
0
Arquivo: x0d.cpp Projeto: crnt/x0
// stage-2 termination handler
void XzeroHttpDaemon::quickShutdownHandler(ev::sig& sig, int)
{
    log(x0::Severity::info, "%s received. shutting down NOW.", sig2str(sig.signum).c_str());

    if (!child_.pid) {
        // we are no garbage parent process
        sd_notify(0, "STATUS=Shutting down.");
    }

    // default to standard signal-handler
    ev_ref(loop_);
    sig.stop();

    // install shutdown timeout handler
    terminationTimeout_.set<XzeroHttpDaemon, &XzeroHttpDaemon::quickShutdownTimeout>(this);
    terminationTimeout_.start(10, 0);
    ev_unref(loop_);

    // kill active HTTP connections
    server_->kill();
}