CAN_FORK_EARLY tests wrong value
daemon/main.c contains:
/* Forking is currently broken with libuv. We need libuv to bind to
* sockets etc. before forking, but at the same time can't touch it before
* forking otherwise it crashes, so it's a chicken and egg problem.
* Disabling until https://github.com/libuv/libuv/pull/846 is done. */
if (forks > 1 && fd_set.len == 0) {
kr_log_error("[system] forking >1 workers supported only on Linux 3.9+ or with supervisor\n");
return EXIT_FAILURE;
}
From the comments, i understand that we are trying to test whether we can open sockets on our own or not. However, testing fd_set.len==0
isn't the right test. we really want to test whether the arguments include -a, or whether the config includes additional net.listen() arguments (including those that might be triggered by a complete lack of any of these -- e.g. via daemon/lua/config.lua
.
I don't know whether it's possible to do these checks at this point in the program, but the test as written doesn't really test the right thing.