Skip to content

Commit

Permalink
Fixed daemonization when using kqueue/kevent. Now the server initiali…
Browse files Browse the repository at this point in the history
…zation is performed *after* the daemonization
  • Loading branch information
antirez committed Dec 5, 2009
1 parent 76d3104 commit 71c54b2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
16 changes: 16 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -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)
============================
Expand Down
6 changes: 3 additions & 3 deletions redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 71c54b2

Please sign in to comment.