Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add cluster or sentinel to proc title #1559

Merged
merged 1 commit into from

2 participants

@mattsta

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]"

@mattsta mattsta 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]"
2c273e3
@antirez antirez merged commit 1d7d1d9 into from
@antirez
Owner

Thanks Matt!

@mattsta mattsta deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 21, 2014
  1. @mattsta

    Add cluster or sentinel to proc title

    mattsta authored
    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]"
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.