Merge pull request #1559 from mattsta/more-detailed-process-title

Add cluster or sentinel to proc title
This commit is contained in:
Salvatore Sanfilippo 2014-02-21 09:32:13 +01:00
commit 1d7d1d9b1f

View File

@ -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