Libevent error 'Bad File Descriptor'

Sara Sioux
Wed, 22 Oct 2003 14:59:35 -0700

Thanks for the prompt responses!  Sorry if my questions are a little
low-brow, I'm not so great at system administration yet.  :)

What are the drawbacks to running memcached in the background, instead
of as a daemon?


-----Original Message-----
From: Brion Vibber [] 
Sent: Wednesday, October 22, 2003 2:53 PM
To: Sara Sioux;
Subject: Re: Libevent error 'Bad File Descriptor'

On Wednesday, Oct 22, 2003, at 14:37 US/Pacific, Sara Sioux wrote:
> memcached -vv -d -m 512 -l -p 1337
> It returns immediately with:
> <3 server listening
> memcached: kevent: Bad file descriptor
> I'm attempting to install this on a FreeBSD 5.0-RELEASE-p4 system. Any

> help and suggestions would be HUGELY appreciated.

This seems to be related to how the open file descriptors get treated 
by the fork to a background process. I posted a workaround which seems 
to work on FreeBSD 5.1-RELEASE yesterday, by forking before doing 
anything substantive:

Alternatively, you can just run it in the background without the -d 
option and it should work fine.

-- brion vibber (brion @