示例#1
0
文件: main.C 项目: nneonneo/rxvt-js
void
sig_handlers::sig_term (ev::sig &w, int revents)
{
  rxvt_emergency_cleanup ();
  w.stop ();
  kill (getpid (), w.signum);
}
示例#2
0
文件: app1.cpp 项目: TwinkleStars/x0
	~MyServer()
	{
		if (sigterm_.is_active()) {
			ev_ref(loop_);
			sigterm_.stop();
		}
	}
示例#3
0
文件: app1.cpp 项目: TwinkleStars/x0
	void terminate_handler(ev::sig& sig, int)
	{
		std::clog << "Terminate signal received ..." << std::endl;

		ev_ref(loop_);
		sig.stop();

		http_->stop();
	}
示例#4
0
文件: x0d.cpp 项目: 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();
}