I don't have ready access to a FreeBSD box, but I'll set up a VM if necessary.
For now, can you try deleting or commenting out most of the daemonize
function in beanstalkd.c? Leave only the last line. It should go from
this:
static void
daemonize()
{
chdir("/");
nullfd(0, O_RDONLY);
nullfd(1, O_WRONLY);
nullfd(2, O_WRONLY);
umask(0);
dfork();
setsid();
dfork();
}
To this:
static void
daemonize()
{
dfork();
}
This change should let you see error messages that happen after the
fork. If you post those messages it'll give me a clue what is going
on.
> When compiling from source,
> "make check" returns a strange error.
That's weird. The command "gcc -g -O2 -I/usr/local/include
-L/usr/local/lib -R/usr/local/lib -o tests/cutcheck -levent
-levent" seems to have no source file in it. Somehow that command was
generated wrong. Unfortunately I'm not so good with the build system.
I'll look at it but I can't predict how long I'll take to fix it.
Antony or other autoconf people, how do we fix this?
kr
> It's a bit more helpful now:
>
> root@skidoo-bsd # /usr/local/bin/beanstalkd -d -u nobody
> root@skidoo-bsd # [warn] kevent: Bad file descriptor
> /usr/local/bin/beanstalkd: beanstalkd.c:290 in main: got here for some
> reason
>
> I'm running libevent 1.4.10 if that helps.
>
> BTW, I have to use the 1.3 release because of the lack of
> posix_fallocate on FreeBSD.
Ah, then I think it's just the same problem we saw on Mac OS. I'll
push a workaround for the posix_fallocate thing today, if possible.
Then I think you can be up and running.
kr
This message http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2008-11/msg00029.html
makes me suspect that FreeBSD has no efficient equivalent to
posix_fallocate.
I just pushed some dumb but portable code to allocate space. It will
be slow, but it should work. (And I'd be wary of trusting the binlog
code in production right now anyway. I won't release it until I'm
confident that it's reasonably safe.)
If you're not using the binlog at all, then there should be no
performance problem on FreeBSD or other systems that lack
posix_fallocate.
kr