On Sat, Jun 12, 2010 at 5:57 PM, Jaume Sabater <[email protected]> wrote:
> On Sat, Jun 12, 2010 at 3:07 PM, Stuart Langridge <[email protected]> > wrote: > > > If I start beanstalkd on port 0, then the OS chooses a random port > > number for me. (I like this because it means I don't have to hardcode > > the ports; I can run two branches of my project simultaneously). > > However...there doesn't appear to be a way to work out which port got > > chosen. Can beanstalk write a log file or similar so I can get > > information about it? > > Why don't you start two instances of beanstalkd with manually chosen > ports so that you know where to connect? > What I've got is a set of scripts which start up my project. That's all contained in a branch (like a git checkout, but with bzr). If I hardcode the port number for beanstalkd to, say, 15151, then I can't start two different branches at ones (because the second one can't use port 15151, as the first is already using it). This is what using port 0 was designed for -- if you try and open TCP port 0, the OS chooses a random unused port for you. This works fine -- beanstalkd happily runs on this randomly chosen port -- but there's no obvious way for me to find out what the randomly chosen port *is*, and there doesn't seem to be a way to ask a running beanstalkd "which port are you running on" without already knowing that port. sil -- You received this message because you are subscribed to the Google Groups "beanstalk-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/beanstalk-talk?hl=en.
