Commit 5a8c9f94 authored by Matt Stancliff's avatar Matt Stancliff Committed by antirez
Browse files

Add cluster or sentinel to proc title

If you launch redis with `redis-server --sentinel` then
in a ps, your output only says "redis-server IP:Port" — this
patch changes the proc title to include [sentinel] or
[cluster] depending on the current server mode:
e.g.  "redis-server IP:Port [sentinel]"
      "redis-server IP:Port [cluster]"
parent ef01bbe1
...@@ -3079,10 +3079,15 @@ void redisOutOfMemoryHandler(size_t allocation_size) { ...@@ -3079,10 +3079,15 @@ void redisOutOfMemoryHandler(size_t allocation_size) {
void redisSetProcTitle(char *title) { void redisSetProcTitle(char *title) {
#ifdef USE_SETPROCTITLE #ifdef USE_SETPROCTITLE
setproctitle("%s %s:%d", char *server_mode = "";
if (server.cluster_enabled) server_mode = " [cluster]";
else if (server.sentinel_mode) server_mode = " [sentinel]";
setproctitle("%s %s:%d%s",
title, title,
server.bindaddr_count ? server.bindaddr[0] : "*", server.bindaddr_count ? server.bindaddr[0] : "*",
server.port); server.port,
server_mode);
#else #else
REDIS_NOTUSED(title); REDIS_NOTUSED(title);
#endif #endif
......
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