FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 06-17-2010, 09:41 PM
Bernie Innocenti
 
Default gethostbyname() and resolv.conf updates

Hello,

xchat in Fedora needs to be restarted after switching to a different
nameserver or it fails to resolve.

The xchat developers say that all xchat does is call gethostbyname(). A
Debian user told me that Debian carries a glibc patch to make processes
notice resolv.conf updates and reload it.

Is there any chance we could apply the same patch in Fedora too? I don't
know all the details, but I guess there might be a good reason why this
patch wasn't upstreamed yet.

--
// Bernie Innocenti - http://codewiz.org/
X/ Sugar Labs - http://sugarlabs.org/

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-17-2010, 09:57 PM
"Jason L Tibbitts III"
 
Default gethostbyname() and resolv.conf updates

>>>>> "BI" == Bernie Innocenti <bernie@codewiz.org> writes:

BI> A Debian user told me that Debian carries a glibc patch to make
BI> processes notice resolv.conf updates and reload it. Is there any
BI> chance we could apply the same patch in Fedora too? I don't know all
BI> the details, but I guess there might be a good reason why this patch
BI> wasn't upstreamed yet.

Well, it never hurts to search bugzilla.

https://bugzilla.redhat.com/show_bug.cgi?id=442172 is, I believe, on
point. There's also
https://bugzilla.redhat.com/show_bug.cgi?id=565880. However, I'm not
sure if or how sssd makes any difference here.

- J<
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-17-2010, 09:57 PM
"Jason L Tibbitts III"
 
Default gethostbyname() and resolv.conf updates

>>>>> "BI" == Bernie Innocenti <bernie@codewiz.org> writes:

BI> A Debian user told me that Debian carries a glibc patch to make
BI> processes notice resolv.conf updates and reload it. Is there any
BI> chance we could apply the same patch in Fedora too? I don't know all
BI> the details, but I guess there might be a good reason why this patch
BI> wasn't upstreamed yet.

Well, it never hurts to search bugzilla.

https://bugzilla.redhat.com/show_bug.cgi?id=442172 is, I believe, on
point. There's also
https://bugzilla.redhat.com/show_bug.cgi?id=565880. However, I'm not
sure if or how sssd makes any difference here.

- J<
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-17-2010, 10:02 PM
Roland McGrath
 
Default gethostbyname() and resolv.conf updates

nscd and sssd exist in part exactly to address this issue.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-17-2010, 10:05 PM
Michal Schmidt
 
Default gethostbyname() and resolv.conf updates

On Thu, 17 Jun 2010 17:41:27 -0400 Bernie Innocenti wrote:
> xchat in Fedora needs to be restarted after switching to a different
> nameserver or it fails to resolve.
>
> The xchat developers say that all xchat does is call gethostbyname().
> A Debian user told me that Debian carries a glibc patch to make
> processes notice resolv.conf updates and reload it.
>
> Is there any chance we could apply the same patch in Fedora too? I
> don't know all the details, but I guess there might be a good reason
> why this patch wasn't upstreamed yet.

Ulrich Drepper always said resolv.conf updates are detected fine when
nscd is running, and that everyone should use it. There's a bug
requesting nscd to be mandatory:
https://bugzilla.redhat.com/show_bug.cgi?id=565880

Michal
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2010, 03:26 AM
Huzaifa Sidhpurwala
 
Default gethostbyname() and resolv.conf updates

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bernie Innocenti wrote:
> Hello,
>
> xchat in Fedora needs to be restarted after switching to a different
> nameserver or it fails to resolve.
>
> The xchat developers say that all xchat does is call gethostbyname(). A
> Debian user told me that Debian carries a glibc patch to make processes
> notice resolv.conf updates and reload it.
>
> Is there any chance we could apply the same patch in Fedora too? I don't
> know all the details, but I guess there might be a good reason why this
> patch wasn't upstreamed yet.
>
I dont think we should patch glibc, unless its upstream.
Looking at the thread at:
http://sources.redhat.com/ml/libc-alpha/2004-09/msg00109.html
it does not appear this patch would make it upstream though.



- --
Regards,
Huzaifa Sidhpurwala, RHCE, CCNA (IRC: huzaifas)

GnuPG Fingerprint:
3A0F DAFB 9279 02ED 273B FFE9 CC70 DCF2 DA5B DAE5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org/

iD8DBQFMGudszHDc8tpb2uURApicAJsFY4D+T59/oLPCMpsPuYMQX4xVVACeK589
3YToGCKcXX0OO8OkqKJJlw8=
=USCv
-----END PGP SIGNATURE-----
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2010, 12:23 PM
Stephen Gallagher
 
Default gethostbyname() and resolv.conf updates

On 06/17/2010 05:41 PM, Bernie Innocenti wrote:
> Hello,
>
> xchat in Fedora needs to be restarted after switching to a different
> nameserver or it fails to resolve.
>
> The xchat developers say that all xchat does is call gethostbyname(). A
> Debian user told me that Debian carries a glibc patch to make processes
> notice resolv.conf updates and reload it.
>
> Is there any chance we could apply the same patch in Fedora too? I don't
> know all the details, but I guess there might be a good reason why this
> patch wasn't upstreamed yet.
>

This is the entire purpose of the res_init() function in glibc. If your
application needs to be aware of a change in resolv.conf, you should be
monitoring it with inotify and calling res_init() anytime the file is
changed.

I disagree that this is necessarily a bug in glibc, as it allows the
application writer to decide for themselves whether to trust a change to
resolv.conf mid-operation.

The easy fix in xchat would be to simply call res_init() immediately
before calling gethostbyname(). It would add a small amount of overhead
to hostname lookups, but it would always work. Monitoring resolv.conf
for changes would be an optimization, of course.

--
Stephen Gallagher
RHCE 804006346421761

Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2010, 12:28 PM
Stephen Gallagher
 
Default gethostbyname() and resolv.conf updates

On 06/17/2010 06:05 PM, Michal Schmidt wrote:
> On Thu, 17 Jun 2010 17:41:27 -0400 Bernie Innocenti wrote:
>> xchat in Fedora needs to be restarted after switching to a different
>> nameserver or it fails to resolve.
>>
>> The xchat developers say that all xchat does is call gethostbyname().
>> A Debian user told me that Debian carries a glibc patch to make
>> processes notice resolv.conf updates and reload it.
>>
>> Is there any chance we could apply the same patch in Fedora too? I
>> don't know all the details, but I guess there might be a good reason
>> why this patch wasn't upstreamed yet.
>
> Ulrich Drepper always said resolv.conf updates are detected fine when
> nscd is running, and that everyone should use it. There's a bug
> requesting nscd to be mandatory:
> https://bugzilla.redhat.com/show_bug.cgi?id=565880
>
> Michal

NSCD should absolutely NOT be mandatory. There are many reasons not to
run it (for example, maybe you actually want your identity lookups to be
sane). NSCD provides unreliable (and occasionally unpredictable)
behavior in identity caching. This is one of the reasons that the SSSD
is being written to replace it. It is strongly advised NOT to run the
SSSD and NSCD simultaneously (Things will still run, but NSCD will be
acting as an additional cache, eliminating the predictability of the
SSSD cache)

--
Stephen Gallagher
RHCE 804006346421761

Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2010, 01:43 PM
Colin Walters
 
Default gethostbyname() and resolv.conf updates

On Fri, Jun 18, 2010 at 8:23 AM, Stephen Gallagher <sgallagh@redhat.com> wrote:
>
> This is the entire purpose of the res_init() function in glibc. If your
> application needs to be aware of a change in resolv.conf, you should be
> monitoring it with inotify and calling res_init() anytime the file is
> changed.

That's awful. Really, really awful. Do you have any idea how many
things would need to be patched to do that? Other operating systems
handle this just fine. Asking every component to use inotify and
res_init() because the glibc maintainers apparently think a simple
stat() on a sure-to-be-in-kernel cache inode is too expensive...well,
think about it.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 06-18-2010, 01:56 PM
Stephen Gallagher
 
Default gethostbyname() and resolv.conf updates

On 06/18/2010 09:43 AM, Colin Walters wrote:
> On Fri, Jun 18, 2010 at 8:23 AM, Stephen Gallagher<sgallagh@redhat.com> wrote:
>>
>> This is the entire purpose of the res_init() function in glibc. If your
>> application needs to be aware of a change in resolv.conf, you should be
>> monitoring it with inotify and calling res_init() anytime the file is
>> changed.
>
> That's awful. Really, really awful. Do you have any idea how many
> things would need to be patched to do that? Other operating systems
> handle this just fine. Asking every component to use inotify and
> res_init() because the glibc maintainers apparently think a simple
> stat() on a sure-to-be-in-kernel cache inode is too expensive...well,
> think about it.

Sorry, my reply was more directed against the assertion that NSCD should
be mandatory to solve this without changes to glibc. I agree that it
would be ideal for gethostbyname() to internally perform a res_init()
when appropriate.

--
Stephen Gallagher
RHCE 804006346421761

Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 03:55 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org