diff --git a/redis.conf b/redis.conf index a131b406f..370542344 100644 --- a/redis.conf +++ b/redis.conf @@ -325,6 +325,11 @@ databases 16 # ASCII art logo in startup logs by setting the following option to yes. always-show-logo no +# By default, Redis modifies the process title (as seen in 'top' and 'ps') to +# provide some runtime information. It is possible to disable this and leave +# the process name as executed by setting the following to no. +set-proc-title yes + ################################ SNAPSHOTTING ################################ # Save the DB to disk. diff --git a/src/config.c b/src/config.c index 5db08f8bc..20d432573 100644 --- a/src/config.c +++ b/src/config.c @@ -2388,6 +2388,7 @@ standardConfig configs[] = { createBoolConfig("rdb-del-sync-files", NULL, MODIFIABLE_CONFIG, server.rdb_del_sync_files, 0, NULL, NULL), createBoolConfig("activerehashing", NULL, MODIFIABLE_CONFIG, server.activerehashing, 1, NULL, NULL), createBoolConfig("stop-writes-on-bgsave-error", NULL, MODIFIABLE_CONFIG, server.stop_writes_on_bgsave_err, 1, NULL, NULL), + createBoolConfig("set-proc-title", NULL, IMMUTABLE_CONFIG, server.set_proc_title, 1, NULL, NULL), /* Should setproctitle be used? */ createBoolConfig("dynamic-hz", NULL, MODIFIABLE_CONFIG, server.dynamic_hz, 1, NULL, NULL), /* Adapt hz to # of clients.*/ createBoolConfig("lazyfree-lazy-eviction", NULL, MODIFIABLE_CONFIG, server.lazyfree_lazy_eviction, 0, NULL, NULL), createBoolConfig("lazyfree-lazy-expire", NULL, MODIFIABLE_CONFIG, server.lazyfree_lazy_expire, 0, NULL, NULL), diff --git a/src/server.c b/src/server.c index a0badea87..ce34af3df 100644 --- a/src/server.c +++ b/src/server.c @@ -5919,7 +5919,7 @@ int main(int argc, char **argv) { readOOMScoreAdj(); initServer(); if (background || server.pidfile) createPidFile(); - redisSetProcTitle(argv[0]); + if (server.set_proc_title) redisSetProcTitle(argv[0]); redisAsciiArt(); checkTcpBacklogSettings(); diff --git a/src/server.h b/src/server.h index 83e007ebe..b72d7bd0d 100644 --- a/src/server.h +++ b/src/server.h @@ -1297,6 +1297,7 @@ struct redisServer { int supervised; /* 1 if supervised, 0 otherwise. */ int supervised_mode; /* See SUPERVISED_* */ int daemonize; /* True if running as a daemon */ + int set_proc_title; /* True if change proc title */ clientBufferLimitsConfig client_obuf_limits[CLIENT_TYPE_OBUF_COUNT]; /* AOF persistence */ int aof_enabled; /* AOF configuration */ diff --git a/tests/unit/introspection.tcl b/tests/unit/introspection.tcl index 0a7f7a9c9..ba28341ff 100644 --- a/tests/unit/introspection.tcl +++ b/tests/unit/introspection.tcl @@ -112,6 +112,7 @@ start_server {tags {"introspection"}} { bio_cpulist aof_rewrite_cpulist bgsave_cpulist + set-proc-title } if {!$::tls} {