http://lists.danga.com/pipermail/memcached/2007-October/005415.html http://bugs.gentoo.org/show_bug.cgi?id=195248 Index: /trunk/server/memcached.c =================================================================== --- a/trunk/server/memcached.c (revision 595) +++ b/trunk/server/memcached.c (revision 604) @@ -2698,9 +2698,10 @@ exit(EXIT_FAILURE); } - /* save the PID in if we're a daemon */ + /* start up worker threads if MT mode */ + thread_init(settings.num_threads, main_base); + /* save the PID in if we're a daemon, do this after thread_init due to + a file descriptor handling bug somewhere in libevent */ if (daemonize) save_pid(getpid(), pid_file); - /* start up worker threads if MT mode */ - thread_init(settings.num_threads, main_base); /* initialise clock event */ clock_handler(0, 0, 0);