From 71c54b21e261536579d350771d13157afeeb84c6 Mon Sep 17 00:00:00 2001 From: antirez Date: Sun, 6 Dec 2009 00:59:35 +0100 Subject: [PATCH] Fixed daemonization when using kqueue/kevent. Now the server initialization is performed *after* the daemonization --- Changelog | 16 ++++++++++++++++ TODO | 3 ++- redis.c | 6 +++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index d8ec60625..aaf38f427 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,19 @@ +2009-12-05 more HTML doc changes +2009-12-05 HTML doc update +2009-12-05 a few redis-cli format specified fixed +2009-12-05 use __attribute__ format in sdscatprintf() when the compiler is GCC. Fixed format bugs resulting from the new warnings. +2009-12-01 TODO update +2009-12-01 compilation problem on 64bit mac os x 10.5 possibly fixed +2009-12-01 virtual memory design doc typos +2009-12-01 design documents added to the project +2009-11-30 Fixed issued #85 (getDecodedObject: Assertion 1 != 1 failed. While sorting a set), added a smarter assert() function to dump the stacktrace, provided a macro to initalize Redis objects on the stack to avoid this kind of bugs. +2009-11-30 fixed a subtle bug in redis-cli not having visible effects +2009-11-29 TODO updated +2009-11-29 Version chagned to 1.100, also known as the first first 2.0 beta version +2009-11-29 more tests in test-redis.tcl, some minor fix +2009-11-29 SORT support for sorted sets +2009-11-28 Implemented LIMIT option in ZRANGEBYSCORE. We now enter feature-freeze +2009-11-28 Changelog updated 2009-11-28 html doc updated 2009-11-28 enable kqueue/kevent only for Mac OS X 10.6.x as it seems that 10.5.x has a broken implementation of this syscalls. 2009-11-28 TODO updated diff --git a/TODO b/TODO index fea2c29cc..2a12f2f38 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,8 @@ VERSION 1.2 TODO (Zsets, Integer encoding, Append only journal) Most of the features already implemented for this release. The following is a list of the missing things in order to release the first beta tar.gz: -* Write docs for the "STORE" operaiton of SORT. Link to the article about SORT by written by defunkt. +* Document "masterauth" in redis.conf, also merge the other related patch if it seems a safe one. +* SETNX and MSETNX should use lookupKeWrite() in order to expire volatile keys when a write attempt is made. VERSION 1.4 TODO (Hash type) ============================ diff --git a/redis.c b/redis.c index b7dc921a8..c6f7b5750 100644 --- a/redis.c +++ b/redis.c @@ -826,8 +826,7 @@ static dictType hashDictType = { * is based on heap allocation for send buffers, so we simply abort. * At least the code will be simpler to read... */ static void oom(const char *msg) { - fprintf(stderr, "%s: Out of memory\n",msg); - fflush(stderr); + redisLog(REDIS_WARNING, "%s: Out of memory\n",msg); sleep(1); abort(); } @@ -6158,6 +6157,7 @@ static void daemonize(void) { FILE *fp; if (fork() != 0) exit(0); /* parent exits */ + printf("New pid: %d\n", getpid()); setsid(); /* create a new session */ /* Every output goes to /dev/null. If Redis is daemonized but @@ -6188,8 +6188,8 @@ int main(int argc, char **argv) { } else { redisLog(REDIS_WARNING,"Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'"); } - initServer(); if (server.daemonize) daemonize(); + initServer(); redisLog(REDIS_NOTICE,"Server started, Redis version " REDIS_VERSION); #ifdef __linux__ linuxOvercommitMemoryWarning();