[Pianod] /etc/resolv.conf issue

Perette Barella perette at barella.org
Fri Sep 6 05:26:40 PDT 2013


Good debugging, Peter.

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.

We probably should do a fix, but we may also want to notify the appropriate group on the Linux side of things and get them to look into a broader fix for the millions of Linux laptop users out there.

It'll be a bit before r150, which should have this patch, ... actually it's a good time to update libpiano and libwaitress too... and the setgroups fixes.  Anything else we should get in there?

Perette

--
Perette Barella • perette at barella.org • 585-286-1312
176 Middlesex Road, Rochester NY 14610

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
> 
> Patching waitress.c to manually re-call res_init() after a getaddrinfo() failure seems to fix things, i.e. pianod can successfully connect on its first 60 second retry after boot.  While Mac OS doesn't seem to have the problem in the first place (probably because it's easier to make sure that pianod doesn't start before the network stack) I believe this patch should be safe in terms of not messing up pianod on Mac OS.  The only thing I'm not sure about is whether we need to link libwaitress against libresolv; it doesn't seem necessary on my Linux, but probably should be in the Makefile to be safe.  Perette maybe you can try it, or else I'll try on a Mac this weekend.
> 
> This does make me wonder why this didn't come up with WSGW, where I recall there being a similar issue...
> 
> I'll look into submitting patch upstream; apparently pianobar is on GitHub?
> P

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deviousfish.com/pipermail/pianod-deviousfish.com/attachments/20130906/6389d5bd/attachment-0003.htm>


More information about the Pianod mailing list