I'd like to ask redis to start on an unoccupied OS-chosen port. I tried --port 0 but, as the docs say, "
If port 0 is specified Redis will not listen on a TCP socket."
Is there some way I'm overlooking of doing this? If not, is it a reasonable feature request?
(In case you're curious, I need to run a redis-server subprocess for some tests and it's nicer to start on arbitrary open port rather than hard-code a port to use which can collide with some other server -- perhaps even a concurrent test invocation. My plan was to ask redis to start on port 0, so the OS would choose the port, and then parse the "* The server is now ready to accept connections on port nnnn" line from the log output.)
Thanks!
Caleb