> -----Original Message----- > From: Nix [mailto:[EMAIL PROTECTED] > Sent: Sunday, August 31, 2008 6:18 PM > To: Giampaolo Tomassoni > Cc: 'Marc Perkel'; users@spamassassin.apache.org > Subject: Re: Handy script for generating /etc/resolv.conf > > On 31 Aug 2008, Giampaolo Tomassoni stated: > > >> How do you arrange that all the existing programs that have already > >> sucked in resolv.conf note the change? They're generally not going > to > >> unless you restart them: nothing polls resolv.conf looking for > changes > >> to it as far as I know, that would be far too inefficient. > > > > Depending on the specific implementation of the resolver library, the > > application may check for changes in the resolv.conf file. Maybe they > don't > > check at every and each resolv request, however: they may instead > check for > > changes every, say, 10 secs or maybe every 1.000 requests. This way, > looking > > for changes in the /etc/resolv.conf file is not that much > inefficient... > > Have you ever seen an implementation that does that? I haven't. glibc > doesn't do it, unless I misread the code severely. Solaris doesn't do > it. Does anything?
Uff! Stock glibc v.2.6.1, source file resolv/res_libc.c, line#167: if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) { _PATH_RESCONF is /etc/resolv.conf; last_mtime is the last modify time (the previous modify time) of the /etc/resolv.conf file. I don't know which glibc version you have, but trust me this code had been there by long time. I you have a "twisted" version of glibc, please share: it is free software and you have to publish any change to it... :) Giampaolo > > -- > `Not even vi uses vi key bindings for its command line.' --- PdS