[Pianod] /etc/resolv.conf issue

Peter Li chinasaurli at gmail.com
Fri Sep 20 10:06:58 PDT 2013


Thanks!  Not sure I understand the details though.  I tried building the 
tarball below on FC18 and I don't get HAVE_RES_INIT in config.h (it's 
commented out).  On the res_init() call, that doesn't link even if you 
link against libresolv?

I'll look into it more soon, including trying to build on RasPi and Mac.
Thanks!
P


On 09/17/2013 07:05 PM, Perette Barella wrote:
> 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/20130920/46f2a00d/attachment-0002.htm>


More information about the Pianod mailing list