Commit 9f770fec authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Save PID file after it is ready to accept connections

parent c39a6696
......@@ -946,10 +946,6 @@ int event_loop() {
redirect_stderr_to_errorlog();
}
if (!get_config()->pid_file.empty()) {
save_pid();
}
SignalServer ssv;
rv = pipe(ssv.ipc_fd.data());
......@@ -996,6 +992,14 @@ int event_loop() {
worker_process_childev.data = nullptr;
ev_child_start(loop, &worker_process_childev);
// Write PID file when we are ready to accept connection from peer.
// This makes easier to write restart script for nghttpx. Because
// when we know that PID file is recreated, it means we can send
// QUIT signal to the old process to make it shutdown gracefully.
if (!get_config()->pid_file.empty()) {
save_pid();
}
ev_run(loop, 0);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment