Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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]"
  • Loading branch information...
commit 2c273e359130f6546aa471ffd0f1855d415a05c5 1 parent d7da507
@mattsta mattsta authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/redis.c
View
9 src/redis.c
@@ -3079,10 +3079,15 @@ void redisOutOfMemoryHandler(size_t allocation_size) {
void redisSetProcTitle(char *title) {
#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,
server.bindaddr_count ? server.bindaddr[0] : "*",
- server.port);
+ server.port,
+ server_mode);
#else
REDIS_NOTUSED(title);
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.