From 7e7a7048fe85cac14fa328735a528a5d96eb746e Mon Sep 17 00:00:00 2001 From: Mike Palmiotto Date: Wed, 4 Mar 2020 03:42:41 +0000 Subject: [PATCH 07/11] Translate descriptions and drop unused fields --- src/backend/postmaster/postmaster.c | 6 +-- src/backend/postmaster/subprocess.c | 65 ++++++++++++----------------- 2 files changed, 29 insertions(+), 42 deletions(-) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 0589fd27f9..8273d53c30 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -5400,8 +5400,8 @@ StartSubprocess(SubprocessType type) argv[argc++] = "postgres"; #ifdef EXEC_BACKEND - snprintf(forkname, sizeof(forkname), "--%s", MySubprocess->progname); - argv[argc++] = psprintf("--%s", MySubprocess->progname); + snprintf(forkname, sizeof(forkname), "--fork%s", MySubprocess->name); + argv[argc++] = forkname; argv[argc++] = NULL; #endif @@ -5463,7 +5463,7 @@ StartSubprocess(SubprocessType type) child_errno = errno; ereport(LOG, - (errmsg("could not fork %s: %m", MySubprocess->desc))); + (errmsg("could not fork %s process: %m", MySubprocess->desc))); /* * fork failure is fatal during startup, but there's no need to choke diff --git a/src/backend/postmaster/subprocess.c b/src/backend/postmaster/subprocess.c index c4fe641456..0bb1ba4655 100644 --- a/src/backend/postmaster/subprocess.c +++ b/src/backend/postmaster/subprocess.c @@ -29,9 +29,8 @@ PgSubprocess *MySubprocess; static PgSubprocess process_types[] = { { - .progname = "boot", - .name = "checker", - .desc = "checker process", + .name = "boot", + .desc = gettext("checker"), .needs_shmem = true, .needs_aux_proc = true, .keep_postmaster_memcontext = false, @@ -41,9 +40,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "boot", - .name = "bootstrap", - .desc = "bootstrap process", + .name = "boot", + .desc = gettext("bootstrap"), .needs_shmem = true, .needs_aux_proc = true, .keep_postmaster_memcontext = false, @@ -53,9 +51,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forkboot", - .name = "startup", - .desc = "startup process", + .name = "boot", + .desc = gettext("startup"), .needs_shmem = true, .needs_aux_proc = true, .keep_postmaster_memcontext = false, @@ -65,9 +62,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forkboot", - .name = "bgwriter", - .desc = "background writer process", + .name = "boot", + .desc = gettext("background writer"), .needs_shmem = true, .needs_aux_proc = true, .keep_postmaster_memcontext = false, @@ -77,9 +73,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forkboot", - .name = "checkpointer", - .desc = "checkpointer process", + .name = "boot", + .desc = gettext("checkpointer"), .needs_shmem = true, .needs_aux_proc = true, .keep_postmaster_memcontext = false, @@ -89,9 +84,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forkboot", - .name = "walwriter", - .desc = "WAL writer process", + .name = "boot", + .desc = gettext("WAL writer"), .needs_shmem = true, .needs_aux_proc = true, .keep_postmaster_memcontext = false, @@ -101,9 +95,9 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forkboot", + .name = "boot", .name = "walreceiver", - .desc = "WAL receiver process", + .desc = gettext("WAL receiver"), .needs_shmem = true, .needs_aux_proc = true, .keep_postmaster_memcontext = false, @@ -113,9 +107,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forkavlauncher", - .name = "autovacuum launcher", - .desc = "autovacuum launcher process", + .name = "avlauncher", + .desc = gettext("autovacuum launcher"), .needs_shmem = true, .needs_aux_proc = false, .keep_postmaster_memcontext = false, @@ -125,9 +118,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forkavworker", - .name = "autovacuum worker", - .desc = "autovacuum worker process", + .name = "avworker", + .desc = gettext("autovacuum worker"), .needs_shmem = true, .needs_aux_proc = false, .keep_postmaster_memcontext = false, @@ -137,9 +129,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forkcol", - .name = "pgstat collector", - .desc = "statistics collector process", + .name = "col", + .desc = gettext("statistics collector"), .needs_shmem = true, .needs_aux_proc = false, .keep_postmaster_memcontext = false, @@ -149,9 +140,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forkarch", - .name = "archiver", - .desc = "archiver process", + .name = "arch", + .desc = gettext("archiver"), .needs_shmem = false, .needs_aux_proc = false, .keep_postmaster_memcontext = false, @@ -161,9 +151,8 @@ static PgSubprocess process_types[] = { .parent_main = NULL }, { - .progname = "forklog", - .name = "logger", - .desc = "system logger", + .name = "log", + .desc = gettext("system logger"), .needs_shmem = false, .needs_aux_proc = false, .keep_postmaster_memcontext = true, @@ -173,9 +162,8 @@ static PgSubprocess process_types[] = { .parent_main = SysLoggerParentMain }, { - .progname = "forkbgworker", .name = "bgworker", - .desc = "background worker", + .desc = gettext("background worker"), .needs_shmem = true, .needs_aux_proc = false, .keep_postmaster_memcontext = true, @@ -185,9 +173,8 @@ static PgSubprocess process_types[] = { .parent_main = BackgroundWorkerParentMain }, { - .progname = "forkbackend", .name = "backend", - .desc = "client backend", + .desc = gettext("client backend"), .needs_shmem = true, .needs_aux_proc = false, .keep_postmaster_memcontext = true, -- 2.21.0