From b3f83f127273da21506f697e256ae010587b10f1 Mon Sep 17 00:00:00 2001 From: Jeremy Zawodny Date: Fri, 19 Mar 2010 22:24:17 -0700 Subject: [PATCH] support for include directive in config parser --- redis.c | 2 ++ redis.conf | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/redis.c b/redis.c index 1701f5ea..ab0fc659 100644 --- a/redis.c +++ b/redis.c @@ -1701,6 +1701,8 @@ static void loadServerConfig(char *filename) { if (server.dbnum < 1) { err = "Invalid number of databases"; goto loaderr; } + } else if (!strcasecmp(argv[0],"include") && argc == 2) { + loadServerConfig(argv[1]); } else if (!strcasecmp(argv[0],"maxclients") && argc == 2) { server.maxclients = atoi(argv[1]); } else if (!strcasecmp(argv[0],"maxmemory") && argc == 2) { diff --git a/redis.conf b/redis.conf index 0ed593d2..fc5ac59d 100644 --- a/redis.conf +++ b/redis.conf @@ -278,3 +278,13 @@ shareobjectspoolsize 1024 # configuration directives. hash-max-zipmap-entries 64 hash-max-zipmap-value 512 + +################################## INCLUDES ################################### + +# Include one or more other config files here. This is useful if you +# have a standard template that goes to all redis server but also need +# to customize a few per-server settings. Include files can include +# other files, so use this wisely. +# +# include /path/to/local.conf +# include /path/to/other.conf