[Pianod] /etc/resolv.conf issue

Perette Barella perette at barella.org
Tue Sep 17 19:05:21 PDT 2013


I read up on res_init, and it sounds like on some platforms (OS X, Windows) it's fixed.  It would be cool if Linux caught up.

In the mean time, I've added this to the test code.  Doing a res_init() call won't link on Mac, so I had to work some Autotools magic to detect viability.  Wanting to avoid changing the libpiano/libwaitress code as much as possible, my solution was to add a res_init() call in the pianod login-to-Pandora code, so it'll get called every 60 seconds until that succeeds.  Once it's up and running, it won't reinitialize anymore.
	http://deviousfish.com/Downloads/pianod/Devel/pianod-test.tar.gz

After running ./configure, check config.h and make sure it has HAVE_RES_INIT defined in there.

Let me know on that and the groups/audio stuff.  I still plan to wrap in the latest libwaitress and libpiano from Pianobar, just haven't gotten there yet.

If I don't hear any screaming about the client changes, I'll promote that soon.

Perette


On 2013年09月06日, at 8:26, Perette Barella wrote:

> I haven't run an experiment, but I hazard that Mac OS X is fixed.  I've never had problems with any kind of application, Cocoa or Unix; I suspect Apple patched the code to reinitialize and update when networks are adjusted.  Avoids glitchy troubles for millions of Mac laptop users on the go.
> 
> 
> On 2013年09月06日, at 4:33, Peter Li wrote:
> 
>> So I finally tracked down a long-standing issue I've had on my Arch Linux ARM RasPi.  Gets back to the bad old days of getaddrinfo()!  Not sure if this is related to problems other people had, but on my system the issue appears to be:
>>     1) pianod starts at boot before the network stack
>>     2) As a result, the first call to getaddrinfo() calls res_init() to load DNS servers from /etc/resolv.conf but they haven't been written into there yet by DHCP.  Bad DNS info gets stored in the process's global _res (I think, or maybe it's _res_state or _res_status or somesuch name)
>>     3) pianod is well behaved and keeps trying to reconnect at 60 second intervals, but it never manages to shake the bad DNS info loaded into the process's globals, so getaddrinfo() continues to return EAI_NONAME ad infinitum
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deviousfish.com/pipermail/pianod-deviousfish.com/attachments/20130917/2fb07b2f/attachment-0002.htm>


More information about the Pianod mailing list