From 617a5766a2ab2fbc7f446a0d8a1d59a6872bd019 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 2 Apr 2021 22:08:19 +0900 Subject: [PATCH] Replace master with main --- doc/sources/index.rst | 2 +- doc/sources/nghttpx-howto.rst | 4 ++-- src/shrpx.cc | 26 +++++++++++++------------- src/shrpx_log.cc | 2 +- src/shrpx_signal.cc | 10 +++++----- src/shrpx_signal.h | 4 ++-- src/shrpx_worker_process.h | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/doc/sources/index.rst b/doc/sources/index.rst index b22dd1fc..db6e7b8e 100644 --- a/doc/sources/index.rst +++ b/doc/sources/index.rst @@ -1,4 +1,4 @@ -.. nghttp2 documentation master file, created by +.. nghttp2 documentation main file, created by sphinx-quickstart on Sun Mar 11 22:57:49 2012. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. diff --git a/doc/sources/nghttpx-howto.rst b/doc/sources/nghttpx-howto.rst index bbb7c20d..4e42485e 100644 --- a/doc/sources/nghttpx-howto.rst +++ b/doc/sources/nghttpx-howto.rst @@ -228,7 +228,7 @@ process. It will do fork and execute new executable, using same command-line arguments and environment variables. As of nghttpx version 1.20.0, that is all you have to do. The new -master process sends QUIT signal to the original process, when it is +main process sends QUIT signal to the original process, when it is ready to serve requests, to shut it down gracefully. For earlier versions of nghttpx, you have to do one more thing. At @@ -239,7 +239,7 @@ current process will exit. At this point, only new nghttpx process exists and serves incoming requests. If you want to just reload configuration file without executing new -binary, send SIGHUP to nghttpx master process. +binary, send SIGHUP to nghttpx main process. Re-opening log files -------------------- diff --git a/src/shrpx.cc b/src/shrpx.cc index fa935cb6..0664612d 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -124,10 +124,10 @@ constexpr auto ENV_UNIX_PATH = StringRef::from_lit("NGHTTP2_UNIX_PATH"); // descriptor. is a path to UNIX domain socket. constexpr auto ENV_ACCEPT_PREFIX = StringRef::from_lit("NGHTTPX_ACCEPT_"); -// This environment variable contains PID of the original master -// process, assuming that it created this master process as a result -// of SIGUSR2. The new master process is expected to send QUIT signal -// to the original master process to shut it down gracefully. +// This environment variable contains PID of the original main +// process, assuming that it created this main process as a result of +// SIGUSR2. The new main process is expected to send QUIT signal to +// the original main process to shut it down gracefully. constexpr auto ENV_ORIG_PID = StringRef::from_lit("NGHTTPX_ORIG_PID"); #ifndef _KERNEL_FASTOPEN @@ -419,7 +419,7 @@ void exec_binary() { // child process - shrpx_signal_unset_master_proc_ign_handler(); + shrpx_signal_unset_main_proc_ign_handler(); rv = shrpx_signal_unblock_all(); if (rv != 0) { @@ -548,7 +548,7 @@ void ipc_send(WorkerProcess *wp, uint8_t ipc_event) { namespace { void reopen_log(WorkerProcess *wp) { - LOG(NOTICE) << "Reopening log files: master process"; + LOG(NOTICE) << "Reopening log files: main process"; auto config = get_config(); auto &loggingconf = config->logging; @@ -1092,7 +1092,7 @@ void close_unused_inherited_addr(const std::vector &iaddrs) { } // namespace namespace { -// Returns the PID of the original master process from environment +// Returns the PID of the original main process from environment // variable ENV_ORIG_PID. pid_t get_orig_pid_from_env() { auto s = getenv(ENV_ORIG_PID.c_str()); @@ -1310,7 +1310,7 @@ namespace { int event_loop() { std::array errbuf; - shrpx_signal_set_master_proc_ign_handler(); + shrpx_signal_set_main_proc_ign_handler(); auto config = mod_config(); @@ -1369,7 +1369,7 @@ int event_loop() { shrpx_sd_notifyf(0, "READY=1"); if (orig_pid != -1) { - LOG(NOTICE) << "Send QUIT signal to the original master process to tell " + LOG(NOTICE) << "Send QUIT signal to the original main process to tell " "that we are ready to serve requests."; kill(orig_pid, SIGQUIT); } @@ -2833,10 +2833,10 @@ Process: --single-process Run this program in a single process mode for debugging purpose. Without this option, nghttpx creates at least - 2 processes: master and worker processes. If this - option is used, master and worker are unified into a - single process. nghttpx still spawns additional process - if neverbleed is used. In the single process mode, the + 2 processes: main and worker processes. If this option + is used, main and worker are unified into a single + process. nghttpx still spawns additional process if + neverbleed is used. In the single process mode, the signal handling feature is disabled. Scripting: diff --git a/src/shrpx_log.cc b/src/shrpx_log.cc index 106aae7c..0c2eae7a 100644 --- a/src/shrpx_log.cc +++ b/src/shrpx_log.cc @@ -189,7 +189,7 @@ Log::~Log() { lgconf->update_tstamp_millis(std::chrono::system_clock::now()); - // Error log format: + // Error log format: // (:) rv = snprintf(buf, sizeof(buf), "%s %d %d %s %s%s%s (%s:%d) %.*s\n", lgconf->tstamp->time_iso8601.c_str(), config->pid, lgconf->pid, diff --git a/src/shrpx_signal.cc b/src/shrpx_signal.cc index 5070d167..63fcc077 100644 --- a/src/shrpx_signal.cc +++ b/src/shrpx_signal.cc @@ -110,7 +110,7 @@ int signal_set_handler(void (*handler)(int), Signals &&sigs) { } // namespace namespace { -constexpr auto master_proc_ign_signals = std::array{SIGPIPE}; +constexpr auto main_proc_ign_signals = std::array{SIGPIPE}; } // namespace namespace { @@ -119,12 +119,12 @@ constexpr auto worker_proc_ign_signals = GRACEFUL_SHUTDOWN_SIGNAL, RELOAD_SIGNAL, SIGPIPE}; } // namespace -int shrpx_signal_set_master_proc_ign_handler() { - return signal_set_handler(SIG_IGN, master_proc_ign_signals); +int shrpx_signal_set_main_proc_ign_handler() { + return signal_set_handler(SIG_IGN, main_proc_ign_signals); } -int shrpx_signal_unset_master_proc_ign_handler() { - return signal_set_handler(SIG_DFL, master_proc_ign_signals); +int shrpx_signal_unset_main_proc_ign_handler() { + return signal_set_handler(SIG_DFL, main_proc_ign_signals); } int shrpx_signal_set_worker_proc_ign_handler() { diff --git a/src/shrpx_signal.h b/src/shrpx_signal.h index 8f668aef..152ca369 100644 --- a/src/shrpx_signal.h +++ b/src/shrpx_signal.h @@ -49,8 +49,8 @@ int shrpx_signal_unblock_all(); // -1. The errno will indicate the error. int shrpx_signal_set(sigset_t *set); -int shrpx_signal_set_master_proc_ign_handler(); -int shrpx_signal_unset_master_proc_ign_handler(); +int shrpx_signal_set_main_proc_ign_handler(); +int shrpx_signal_unset_main_proc_ign_handler(); int shrpx_signal_set_worker_proc_ign_handler(); int shrpx_signal_unset_worker_proc_ign_handler(); diff --git a/src/shrpx_worker_process.h b/src/shrpx_worker_process.h index 01e3e671..a2a7dc7a 100644 --- a/src/shrpx_worker_process.h +++ b/src/shrpx_worker_process.h @@ -32,7 +32,7 @@ namespace shrpx { class ConnectionHandler; struct WorkerProcessConfig { - // IPC socket to read event from master process + // IPC socket to read event from main process int ipc_fd; // IPv4 or UNIX domain socket, or -1 if not used int server_fd;