Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Apr 2002 08:51:02 -0500 (CDT)
From:      bdodson@scms.utmb.edu
To:        bsd@perimeter.co.za
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: resolver library and changes in /etc/resolv.conf
Message-ID:  <200204201351.g3KDp3332824@scms.utmb.edu>
In-Reply-To: <200204200938.22612@.perimeter.co.za>

next in thread | previous in thread | raw e-mail | index | archive | help
On 20 Apr, Patrick O'Reilly wrote:
> On Fri 19 Apr 02 02:33, M. L. Dodson wrote:
>> I had the occasion to change the name server
>> entries in /etc/resolv.conf.  I thought (wrongly it turns out)
>> that I could just make the changes, and they would be picked up
>> automatically.
> 
> Bud,
> That has always worked for me!
> 

That's what I originally thought, also.  But a reply made the point that
having sendmail (or other networking daemons) pick up the resolv.conf
changes automatically generates a race condition.  The example given
was: you make a change in a MX record in the named configuration, and
also make a change in /etc/resolv.conf.  You may lose email depending on
the exact timing of these two actions.

It was pointed out to me that Unix did not originate in Redmond: "Do
exactly what I tell you to do, not what you think I meant."
(paraphrased) was the comment appended. :-)  (Although Windows probably
makes you reboot after such a change. 8-)

> You aren't running named on the box are you?  

No.

> Remember that resolv.conf 
> is used for client processes to find nameservers, but the named process 
> uses the "forwarders" entry in named.conf to find other (upstream) 
> nameservers.  But if you are not using named at all then this should 
> not be your problem.
> 
>> Is this sendmail remembering the name server list it
>> got when it was started? Can I just send it a HUP and have it pick up
>> the changes?  I know that going down to single user and back to
>> multiuser is sufficient, but is there a less intrusive way to force
>> the changes to be recognized?  I would like a procedure that worked
>> globally for all processes, not just sendmail, if possible.
> 
> here's my favorite "One size fits all" solution:
> 
> # kill -HUP `head -1 /var/run/sendmail.pid`
> 

That's what I thought (which you and others have confirmed),
but I was not very open to verifying that by experimentation on an
important live server.

> You can substitute most other daemon names where
"sendmail" appears, 
> and it will work.  For a full list, try:
> 
> # ls -al /var/run/*.pid
> 

I think that would miss apache which keeps its .pid file elsewhere, I
believe. This makes the assumption that the HUP semantics understood by
the daemon includes "reread your configuration files", which is probably 
generally true, but one can conceive of pathological daemons that 
ignore the HUP signal, for example.

We really need the NetBSD rc system (integration of which is being
worked on, slowly).  Then starting, restarting, stopping whole services
and their dependencies would be straightforward (the details of the
requirements being encapsulated in the appropriate rc script).

Thanks,
Bud

>> TIA,
>>
>> Bud Dodson
> 

-- 
M. L. Dodson                                bdodson@scms.utmb.edu
409-772-2178                                FAX: 409-772-1790


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204201351.g3KDp3332824>