Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-30 Thread Phil Savoie
ken wrote:
> On 10/29/2009 04:03 PM Dave wrote:
>> On Thu, Oct 29, 2009 at 9:00 AM, Meenoo Shivdasani > > wrote:
>>
>>
>> BOOTPROTO=bootp is triggering it.
>>
>>
>> I'm confused. I just rebooted another machine with 'BOOTPROTO=bootp' in
>> /etc/sysconfig/network-scripts/ifup-eth, it did not rewrite
>> /etc/resolv.conf.
>>
>> 
> 
> I haven't followed the entire discussion, but do you have correct
> settings in /etc/sysconfig/networking/devices/ifcfg-eth0 (or whatever
> the NIC is) and the two relevant files in
> /etc/sysconfig/networking/profiles/default/ ??
> 
> hth,
> ken

To add to Ken's answer...  The setting is PEERDNS in the
/etc/sysconfig/network-scripts/ifcfg-eth? file.  If PEERDNS is set to
"yes" then the resolv.conf file will be rewritten on every reboot.  If
set to "no" then the resolv.conf should not change.

BTW, I have not read the OP's original post and basing my answer just on
the subject line.

Phil
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-30 Thread ken
On 10/29/2009 04:03 PM Dave wrote:
> On Thu, Oct 29, 2009 at 9:00 AM, Meenoo Shivdasani  > wrote:
> 
> 
> BOOTPROTO=bootp is triggering it.
> 
> 
> I'm confused. I just rebooted another machine with 'BOOTPROTO=bootp' in
> /etc/sysconfig/network-scripts/ifup-eth, it did not rewrite
> /etc/resolv.conf.
> 
> 

I haven't followed the entire discussion, but do you have correct
settings in /etc/sysconfig/networking/devices/ifcfg-eth0 (or whatever
the NIC is) and the two relevant files in
/etc/sysconfig/networking/profiles/default/ ??

hth,
ken
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-29 Thread Dave
On Thu, Oct 29, 2009 at 9:00 AM, Meenoo Shivdasani  wrote:
>
>
> BOOTPROTO=bootp is triggering it.
>

I'm confused. I just rebooted another machine with 'BOOTPROTO=bootp' in
/etc/sysconfig/network-scripts/ifup-eth, it did not rewrite
/etc/resolv.conf.

Okay, my goof, the one with the problem is actually running fc9. Sorry.

I will try

 sed -i "s/BOOTPROTO=bootp/BOOTPROTO=none/"
/etc/sysconfig/network-scripts/ifup-eth

mahalo,
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-29 Thread Meenoo Shivdasani
> /etc/sysconfig/network-scripts/ifup-eth:    BOOTPROTO=bootp

> So, it's not PEERDNS, not DHCP, not NetworkManager. Why is dhclient-script
> even being run?

BOOTPROTO=bootp is triggering it.

In /etc/sysconfig/network-scripts/ifup-eth:

if [ "${BOOTPROTO}" = "bootp" -o "${BOOTPROTO}" = "dhcp" ]; then
DYNCONFIG=true
fi

Then, later on in that script:

if [ -n "${DYNCONFIG}" -a -x /sbin/dhclient ]; then

do a bunch of stuff related to dynamically assigned addresses and names.

And finally:

if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
echo $" done."
else

> Maybe I should disable selinux altogether, instead of just making it
> permissive? I think I'll try that.

selinux shouldn't have anything to do with the resolv.conf file being
rewritten -- unless it's set to enforcing and something that isn't
allowed to do so is trying to rewrite the file.

HTH,

M
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-29 Thread Dave
The consensus of the list seemed to be that I should change the PEERDNS
variable. It seems not to be working. The machine rebooted yesterday,
/etc/resolv.conf got rewritten again. And yet:

 find /etc/sysconfig/ -type f -exec grep -iH 'peerdns=' {} \;
/etc/sysconfig/network-scripts/ifcfg-eth0:PEERDNS=no
/etc/sysconfig/network-scripts/ifcfg-eth0.old:PEERDNS=yes
/etc/sysconfig/networking/profiles/default/ifcfg-eth0:PEERDNS=no
/etc/sysconfig/networking/devices/ifcfg-eth0:PEERDNS=no
# chkconfig --list|grep Net
NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off
# /etc/init.d/NetworkManager status
NetworkManager is stopped
# find /etc/sysconfig/ -type f -exec grep -iH 'bootproto=' {} \;
/etc/sysconfig/network-scripts/ifcfg-eth0:BOOTPROTO=none
/etc/sysconfig/network-scripts/ifcfg-eth0.old:BOOTPROTO=none
/etc/sysconfig/network-scripts/ifup-eth:BOOTPROTO=bootp
/etc/sysconfig/networking/profiles/default/ifcfg-eth0:BOOTPROTO=none
/etc/sysconfig/networking/devices/ifcfg-eth0:BOOTPROTO=none
# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search soest.hawaii.edu
nameserver 1...
nameserver 1...


So, it's not PEERDNS, not DHCP, not NetworkManager. Why is dhclient-script
even being run?

Maybe I should disable selinux altogether, instead of just making it
permissive? I think I'll try that.

# grep resol  /sbin/dhclient-script
make_resolv_conf() {
save_previous /etc/resolv.conf
change_resolv_conf $rscf
for resolvfile in /etc/resolv.conf* ; do
/sbin/restorecon $resolvfile >/dev/null 2>&1
make_resolv_conf
if [ -f /etc/resolv.conf.predhclient.$interface ]; then
change_resolv_conf /etc/resolv.conf.predhclient.$interface
rm -f /etc/resolv.conf.predhclient.$interface
[r...@lee1 ~]# getenforce
Permissive

How badly would things blow up if I did this?

chmod a-w /etc/resolv.conf

mahalo,
Dave


On Thu, Oct 8, 2009 at 7:41 AM, Dave

> wrote:

> My machine has a static IP, with dhcp and IPv6 disabled. Every time I
> reboot, some process rewrites /etc/resolv.conf, including a comment
> about dhcpclient. The only package I have installed that shows up in
> "rpm -qa|grep -i dhcp" is dhcpv6-client-1.0.10-16.el5, and nothing in
> there is named dhcpclient.
>
> I'd like to figure out what software is rewriting this file and why.
> man 5 resolv.conf  and man resolver are unhelpful in this case. rpm
> reports /etc/resolv.conf is not owned by any package.
>
> At this point, I am as (or more) interested in pointers regarding how
> to find the answer as I am in the actual answer. Please teach me to
> fish.
>
> mahalo,
> Dave
>



-- 
———-
Q: Why should this email be 5 sentences or less?
A: http://five.sentenc.es
IPRC-help FAQ: https://wailua/wiki/index.php/Faq
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-09 Thread Dave
On Thu, Oct 8, 2009 at 2:54 PM, Joseph L. Casale
 wrote:
>>Just one of those things you kind of pick up as you go along and
>>remember.  Tribal knowledge if you will.
>
> There's two pdf's and one command I use "often" :)
>
> The redhat 5.3 deployment and installation pdf's (or the online versions)

That looks useful to know.

> and:
>
> # find /usr/share/doc/ -exec grep "PEERDNS" '{}' \; -print
>    PEERDNS=yes|no
>      file if PEERDNS is not set to "no".
> /usr/share/doc/initscripts-8.45.25/sysconfig.txt
>    honor PEERDNS=no for pump and dhcpcd too (#18619)
>    DEFROUTE defaults on; PEERDNS documented and defaults on
> /usr/share/doc/initscripts-8.45.25/ChangeLog
>
> Now you know what doc to read...

Yeah, but by the time I knew PEERDNS was involved, all the hard work
was done. Try that find command with 'resolv.conf' instead of PEERDNS
and you get way too many hits.

mahalo,
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-09 Thread Dave
On Thu, Oct 8, 2009 at 11:40 PM, Marcelo M. Garcia
 wrote:
> Is network-manager enabled?

No.
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-09 Thread Dave
On Thu, Oct 8, 2009 at 2:20 PM, Ray Van Dolson  wrote:
> On Thu, Oct 08, 2009 at 01:32:39PM -1000, Dave wrote:
>> Wow, there it is. I guess I could've found it by doing a careful
>> search of the initscripts package, which contains/owns
>> /etc/sysconfig/network-scripts/ifcfg-eth0, which was the only script
>> in /etc/ that invokes /sbin/dhclient, which a comment in
>> /etc/resolv.conf revealed to be the program that wrote it.
>
> Just one of those things you kind of pick up as you go along and
> remember.  Tribal knowledge if you will.
>
> Where exactly did you attempt to look first?

   man 5 resolv.conf
Not saying it was smart.
second try was
   rpm -qf /etc/resolv.conf
on the theory that some package ought to own every config file and
have some sort of documentation about the files it owns. Not much of a
theory.

>I'm just trying to think
> of where a more obvious place to look would be first.  Perhaps a man
> page documenting all the ifcfg type settings?  man ifcfg?

That would have taken me just as long as this process did, since I had
no connection in my brain initially between resolv.conf and ifcfg. I
think if there was an obvious good candidate, we would not be talking
about this, I'd have found my answer right away on my own.

I think Meenoo Shivdasani probably had the best idea, to google the
message I found in my modified /etc/resolv.conf.

best,
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-09 Thread Barry Brimer
I haven't been following this thread very closely since my last post, but 
if you want to know who is doing what ... use auditctl. 


Barry
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-09 Thread Frank Thommen
Dave wrote:
> On Thu, Oct 8, 2009 at 11:44 AM, Craig White  wrote:
>> On Thu, 2009-10-08 at 11:19 -1000, Dave wrote:
>>> [r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
> [snip]
>>> PEERDNS=yes
>> - ^^^
>> change to PEERDNS=no
> 
> 
> What man page would tell me what this means? How should I have known
> that's what I should do, if I were lacking the luxury of being told by
> one wiser than myself?

It's in /usr/share/doc/initscripts-/sysconfig.txt


Cheers

   frank
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-09 Thread Marcus Moeller
Hi,

> One option would be to comment out the make_resolv_conf()  function in
> /sbin/dhclient-script.

btw. a more common way would be to create a /etc/dhclient-enter-hooks



with the following content:


make_resolv_conf(){

   :

}


Best Regards
Marcus
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-09 Thread Marcelo M. Garcia
Dave wrote:
> My machine has a static IP, with dhcp and IPv6 disabled. Every time I
> reboot, some process rewrites /etc/resolv.conf, including a comment
> about dhcpclient. The only package I have installed that shows up in
> "rpm -qa|grep -i dhcp" is dhcpv6-client-1.0.10-16.el5, and nothing in
> there is named dhcpclient.
> 
> I'd like to figure out what software is rewriting this file and why.
> man 5 resolv.conf  and man resolver are unhelpful in this case. rpm
> reports /etc/resolv.conf is not owned by any package.
> 
> At this point, I am as (or more) interested in pointers regarding how
> to find the answer as I am in the actual answer. Please teach me to
> fish.
> 
> mahalo,
> Dave
Hi

Is network-manager enabled?

Regards

mg.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Rob Townley
On Thu, Oct 8, 2009 at 4:39 PM, Dave  wrote:
> On Thu, Oct 8, 2009 at 11:27 AM, Meenoo Shivdasani  wrote:
>> /etc/init.d/network calls /etc/sysconfig/network-scripts/ifup which
>> calls /sbin/dhclient which calls /sbin/dhclient-script which
>> overwrites your resolv.conf with the info it gets from the DHCP server
>> on the network.
>
>
> How would I find this out on my own? And it seems not to be correct.
> At least, if /etc/sysconfig/network-scripts/ifup calls
> /sbin/dhclient, it must use some indirection, as dhclient is not
> mentioned in the script explicitly:
>
> grep -i dhc /etc/sysconfig/network-scripts/ifup
> if [ "${BOOTPROTO}" = "bootp" -o "${BOOTPROTO}" = "dhcp" ]; then
>
>
> Why does it overwrite /etc/resolv.conf when the machine is not set to
> use DHCP? The IP address etc. is set statically using
> /usr/bin/system-config-network.
>
> Dave
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>

i feel the pain as i went through this just last night on a multihomed
CentOS 5.3 box.  It was using old and wrong lease info which helped me
notice it as a problem.

i ended up deleting:

/var/lib/dhcpd/dhclient.leases
/var/lib/dhcpd/dhclient.leases~
/etc/dhclient.conf  (but you should make a backup or at least look at
the dhclient.conf because i think you can tell it what ethX to work on
or not).
rm anything else associated with dhclient

Some guys say to uninstall NetworkManager, not just keep it from running.

Setting a static dhcp lease in our separate dhcpd server you would
think would fix this.  But static lease made things worse because
dhclient broke /etc/sysconfig/network-scripts/ifup-routes calls to
'/sbin/ip/route add" and "/sbin/ip/rule add".  With dhclient, i could
not set a default gw rule for each different network interface card.
After deleting the lease info and maybe changing the
/etc/dhclient.conf and then deleting it, i could have a separate
default gateway for each nic.

Ok, the other BUG is ping.  There is a bug in ping that has sucked up
much of my life for the last 2 or 3 years.  i will post separately on
the ping -I bug.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread William L. Maltby

On Fri, 2009-10-09 at 00:54 +, Joseph L. Casale wrote:
> 

> Also:
> man -K PEERDNS
> But that's generally a slow and last ditch effort even after google:)
> It also never helped with this string but its useful to know.

And don't forget to run "makewhatis" occasionally (if not automatically
done) so that the "man -k" and apropos have a current database to
search.

> 

-- 
Bill

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Joseph L. Casale
>Just one of those things you kind of pick up as you go along and
>remember.  Tribal knowledge if you will.

There's two pdf's and one command I use "often" :)

The redhat 5.3 deployment and installation pdf's (or the online versions)
and:

# find /usr/share/doc/ -exec grep "PEERDNS" '{}' \; -print
PEERDNS=yes|no
  file if PEERDNS is not set to "no".
/usr/share/doc/initscripts-8.45.25/sysconfig.txt
honor PEERDNS=no for pump and dhcpcd too (#18619)
DEFROUTE defaults on; PEERDNS documented and defaults on
/usr/share/doc/initscripts-8.45.25/ChangeLog

Now you know what doc to read...

Also:
man -K PEERDNS
But that's generally a slow and last ditch effort even after google:)
It also never helped with this string but its useful to know.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Ray Van Dolson
On Thu, Oct 08, 2009 at 01:32:39PM -1000, Dave wrote:
> On Thu, Oct 8, 2009 at 11:57 AM, Barry Brimer  wrote:
> > Quoting Dave :
> >> On Thu, Oct 8, 2009 at 11:44 AM, Craig White  
> >> wrote:
> >> > On Thu, 2009-10-08 at 11:19 -1000, Dave wrote:
> >> >> [r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
> >> [snip]
> >> >> PEERDNS=yes
> >> > - ^^^
> >> > change to PEERDNS=no
> >>
> >> What man page would tell me what this means? How should I have known
> >> that's what I should do, if I were lacking the luxury of being told by
> >> one wiser than myself?
> >
> > /usr/share/doc/initscripts-*/sysconfig.txt
> 
> Wow, there it is. I guess I could've found it by doing a careful
> search of the initscripts package, which contains/owns
> /etc/sysconfig/network-scripts/ifcfg-eth0, which was the only script
> in /etc/ that invokes /sbin/dhclient, which a comment in
> /etc/resolv.conf revealed to be the program that wrote it.

Just one of those things you kind of pick up as you go along and
remember.  Tribal knowledge if you will.

Where exactly did you attempt to look first?  I'm just trying to think
of where a more obvious place to look would be first.  Perhaps a man
page documenting all the ifcfg type settings?  man ifcfg?

Ray
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 11:57 AM, Meenoo Shivdasani  wrote:
> Are there any interfaces that have BOOTPROTO=dhcp?  Perhaps one that's
> not connected to the network?
>
> grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg*

 grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg*
/etc/sysconfig/network-scripts/ifcfg-eth0:BOOTPROTO=none


mahalo,
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 1:04 PM, Robert Heller  wrote:
> At Thu, 08 Oct 2009 14:54:36 -0700 CentOS mailing list  
> wrote:
>> Dave wrote:
>> BOOTPROTO=none
>
> Shouldn't that be:
>
> BOOTPROTO=static

My options (according to  /usr/share/doc/initscripts-8.76.4/sysconfig.txt) are:
BOOTPROTO=none|bootp|dhcp

This was all set by the network panel (/usr/bin/system-config-network).

I have an embarrassing admission to make - I just realized the system
I was looking at is running fedora 9. I've noticed the same behavior
on my centos systems, though.


Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 11:57 AM, Barry Brimer  wrote:
> Quoting Dave :
>> On Thu, Oct 8, 2009 at 11:44 AM, Craig White  wrote:
>> > On Thu, 2009-10-08 at 11:19 -1000, Dave wrote:
>> >> [r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
>> [snip]
>> >> PEERDNS=yes
>> > - ^^^
>> > change to PEERDNS=no
>>
>> What man page would tell me what this means? How should I have known
>> that's what I should do, if I were lacking the luxury of being told by
>> one wiser than myself?
>
> /usr/share/doc/initscripts-*/sysconfig.txt

Wow, there it is. I guess I could've found it by doing a careful
search of the initscripts package, which contains/owns
/etc/sysconfig/network-scripts/ifcfg-eth0, which was the only script
in /etc/ that invokes /sbin/dhclient, which a comment in
/etc/resolv.conf revealed to be the program that wrote it.

Thanks guys,
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 1:04 PM, Robert Heller  wrote:
> Is NetworkManager running?  If so, stop it:
>
 /etc/init.d/NetworkManager status
NetworkManager is stopped

mahalo,
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Robert Heller
At Thu, 8 Oct 2009 11:19:18 -1000 CentOS mailing list  wrote:

> 
> On Thu, Oct 8, 2009 at 9:49 AM, Spiro Harvey  wrote:
> > chkconfig for dhclient too, and see what that results.
> 
> 
> [root@ ~]# chkconfig --list|grep  -e dh -e clie
> [root@ ~]#
> 
> >
> > Also, look at /etc/sysconfig/network-scripts/ifcfg-eth0.
> 
> 
> [r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
> # Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express
> DEVICE=eth0
> BOOTPROTO=none
BOOTPROTO=static
> HWADDR=00:18:8b:0f:ad:c2
> IPADDR=1[snip]0
> ONBOOT=yes
> DHCP_HOSTNAME=[snip]
???
> DNS1=1[snip]0
> DNS2=1[snip].2
???
> NM_CONTROLLED=no
> SEARCH=[snip]
> NETMASK=255.255.255.0
> DNS3=1[snip]0
???
> GATEWAY=1[snip]0.1
> TYPE=Ethernet
> USERCTL=no
> PEERDNS=yes
???
> IPV6INIT=no
> 
> >
> > It's possible to have addresses "statically" assigned via DHCP based on
> > MAC addresses. If resolv.conf is getting populated by dhclient, then
> > I'm guessing the odds of you having a dhcp server on your network is
> > good. :)
> 
> You guessed right. But the question remains, what software is writing the 
> file?
> 
> > In all likelihood, you have a static IP assigned in your ifcfg-eth0,
> > and the resolv.conf is being over-written by dhclient.
> 
> What is invoking dhclient, how do I find it?
>  rpm -qR dhclient
> /bin/bash
> initscripts >= 6.75
> libc.so.6()(64bit)
> libc.so.6(GLIBC_2.2.5)(64bit)
> libc.so.6(GLIBC_2.3)(64bit)
> libc.so.6(GLIBC_2.3.4)(64bit)
> libc.so.6(GLIBC_2.4)(64bit)
> libc.so.6(GLIBC_2.8)(64bit)
> rpmlib(CompressedFileNames) <= 3.0.4-1
> rpmlib(PayloadFilesHavePrefix) <= 4.0-1
> rpmlib(VersionedDependencies) <= 3.0.3-1
> rtld(GNU_HASH)
> 
> Dave
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
> 
>   
>  

-- 
Robert Heller -- 978-544-6933
Deepwoods Software-- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
hel...@deepsoft.com   -- http://www.deepsoft.com/ModelRailroadSystem/
  
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Robert Heller
At Thu, 08 Oct 2009 14:54:36 -0700 CentOS mailing list  
wrote:

> 
> Dave wrote:
> > 
> > [r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
> > # Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express
> > DEVICE=eth0
> > BOOTPROTO=none
> > HWADDR=00:18:8b:0f:ad:c2
> > IPADDR=1[snip]0
> > ONBOOT=yes
> > DHCP_HOSTNAME=[snip]
> > DNS1=1[snip]0
> > DNS2=1[snip].2
> > NM_CONTROLLED=no
> > SEARCH=[snip]
> > NETMASK=255.255.255.0
> > DNS3=1[snip]0
> > GATEWAY=1[snip]0.1
> > TYPE=Ethernet
> > USERCTL=no
> > PEERDNS=yes
> > IPV6INIT=no
> 
> Holy cow, something put every single option in that file.
> For static address, the minimum you need is this:
> 
> DEVICE=eth0
> BOOTPROTO=none

Shouldn't that be:

BOOTPROTO=static

> HWADDR=00:18:8b:0f:ad:c2
> IPADDR=1[snip]0
> ONBOOT=yes
> NETMASK=255.255.255.0
> TYPE=Ethernet
> 
> And you can either leave GATEWAY there or put it in /etc/sysconfig/network
> 
> I assume it's because of PEERDNS=yes, and you'll have to try to be sure, 
> but anyway all that junk serves no purpose there (well, arguably you 
> could put back USERCTL and stuff like that, if you really need it).
> 

-- 
Robert Heller -- 978-544-6933
Deepwoods Software-- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
hel...@deepsoft.com   -- http://www.deepsoft.com/ModelRailroadSystem/
  
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Robert Heller
At Thu, 8 Oct 2009 07:41:33 -1000 CentOS mailing list  wrote:

> 
> My machine has a static IP, with dhcp and IPv6 disabled. Every time I
> reboot, some process rewrites /etc/resolv.conf, including a comment
> about dhcpclient. The only package I have installed that shows up in
> "rpm -qa|grep -i dhcp" is dhcpv6-client-1.0.10-16.el5, and nothing in
> there is named dhcpclient.
> 
> I'd like to figure out what software is rewriting this file and why.
> man 5 resolv.conf  and man resolver are unhelpful in this case. rpm
> reports /etc/resolv.conf is not owned by any package.
> 
> At this point, I am as (or more) interested in pointers regarding how
> to find the answer as I am in the actual answer. Please teach me to
> fish.

Is NetworkManager running?  If so, stop it:

sudo /sbin/service NetworkManager stop

and disable it:

sudo /sbin/chkconfig NetworkManager off



> 
> mahalo,
> Dave
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
> 
>   
> 

-- 
Robert Heller -- 978-544-6933
Deepwoods Software-- Download the Model Railroad System
http://www.deepsoft.com/  -- Binaries for Linux and MS-Windows
hel...@deepsoft.com   -- http://www.deepsoft.com/ModelRailroadSystem/
   
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 11:50 AM, Dave  wrote:
> On Thu, Oct 8, 2009 at 10:29 AM, Florin Andrei  wrote:
>> What is the output of these commands?
>>
>> rpm -qa | grep dhc
>> # to see what's actually installed as a package
>
>  rpm -qa | grep dhc
> dhcpv6-client-1.0.14-1.fc9.x86_64
> libdhcp4client-4.0.0-22.fc9.x86_64
> libdhcp6client-1.0.14-1.fc9.x86_64
> libdhcp-1.99.8-1.fc9.x86_64
> dhclient-4.0.0-22.fc9.x86_64
>
>
>>
>> find / -name dhclient
>> # to see if and where is the executable installed
>
> I hope this is an acceptable substitute:
>  rpm -qfs /sbin/dhclient
> normal        /sbin/dhclient
> normal        /sbin/dhclient-script
> normal        /usr/share/doc/dhclient-4.0.0
> normal        /usr/share/doc/dhclient-4.0.0/dhclient.conf.sample
> normal        /usr/share/man/man5/dhclient.conf.5.gz
> normal        /usr/share/man/man5/dhclient.leases.5.gz
> normal        /usr/share/man/man5/dhcp-eval.5.gz
> normal        /usr/share/man/man5/dhcp-options.5.gz
> normal        /usr/share/man/man8/dhclient-script.8.gz
> normal        /usr/share/man/man8/dhclient.8.gz
> normal        /var/lib/dhclient
>
>
>>
>> grep -rI dhclient /etc | grep -v selinux | grep -v /ifup-eth: \
>>        | grep -v /ifdown-eth:
>> # to see if it's called from somewhere else than the regular places
>
> Substituting:
>  find /etc -type f -exec grep -iH dhclient {} \; | grep -v selinux
[snip]
> /etc/sysconfig/network-scripts/ifup-eth:if [ -n "${DYNCONFIG}" -a -x
> /sbin/dhclient ]; then
> /etc/sysconfig/network-scripts/ifup-eth:    # Remove any temporary
> references which were previously added to dhclient config
[snip]


Previous poster Meenoo Shivdasani was close, looks like it is
/etc/sysconfig/network-scripts/ifup-eth (not
/etc/sysconfig/network-scripts/ifup) that invokes dhclient.
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Florin Andrei
Joseph L. Casale wrote:
>> Yes, I know the docs. What I was saying is - it will not help finding
>> the cause, which is what the OP requested. It will just make the problem
>> go away.
> 
> Uhm, am I missing something? It *is* the cause?
> Its designed to do just what it's doing, and here's a real shocker, it's 
> doing it:)

Take a step back and look at the whole picture.

Your suggestion will override a DHCP-related config item somewhere else.

Yes, it will likely stop the system from over-writing resolv.conf - in 
that, you are correct.

No, it will not satisfy the requirement of the the o.p. which was, I 
quote: "At this point, I am as (or more) interested in pointers 
regarding how to find the answer as I am in the actual answer. Please 
teach me to fish."

What I'm trying to do here is to help the o.p. to find what causes the 
modification of resolv.conf, not how to cover up the issue. It's easy to 
hide the problem, either do what you suggest, or edit away 
make_resolv_conf(). But the underlying cause will remain, and may 
resurface if these changes are undone.

-- 
Florin Andrei

http://florin.myip.org/

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Meenoo Shivdasani
On Thu, Oct 8, 2009 at 5:39 PM, Dave  wrote:
> On Thu, Oct 8, 2009 at 11:27 AM, Meenoo Shivdasani  wrote:
>> /etc/init.d/network calls /etc/sysconfig/network-scripts/ifup which
>> calls /sbin/dhclient which calls /sbin/dhclient-script which
>> overwrites your resolv.conf with the info it gets from the DHCP server
>> on the network.
>
>
And it seems not to be correct.
> At least, if /etc/sysconfig/network-scripts/ifup calls
> /sbin/dhclient, it must use some indirection, as dhclient is not
> mentioned in the script explicitly:

My bad -- on the 4.x system I referred to, ifup is where it's called.

On my 5.x system, it's called by ifup-eth.

> Why does it overwrite /etc/resolv.conf when the machine is not set to
> use DHCP? The IP address etc. is set statically using
> /usr/bin/system-config-network.

Are there any interfaces that have BOOTPROTO=dhcp?  Perhaps one that's
not connected to the network?

grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg*

> How would I find this out on my own?

That's a harder one to answer.  I would start with the comment that
got added to the resolv.conf file -- and Google resolv.conf dhclient.
That brings up hits that describe several ways of avoiding the whole
issue (and confirms for you that you're on the right track).  man
dhclient mentions dhclient-script, then poking around in various etc
directories gets you to where it gets called from.

Making the leap to figuring out that PEERDNS is one of the ways that
you can control whether or not resolv.conf gets modified would mean
looking through the various definitions in ifcfg-eth0 and making sure
that you know what each one does.  When you hit one that you don't
recognize, look it up.  In this case:

PEERDNS=, where  is one of the following:
  yes — Modify /etc/resolv.conf if the DNS directive is set. If
using DCHP, then yes is the default.
  no — Do not modify /etc/resolv.conf.

M
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Barry Brimer
Quoting Dave :

> On Thu, Oct 8, 2009 at 11:44 AM, Craig White  wrote:
> > On Thu, 2009-10-08 at 11:19 -1000, Dave wrote:
> >> [r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
> [snip]
> >> PEERDNS=yes
> > - ^^^
> > change to PEERDNS=no
>
>
> What man page would tell me what this means? How should I have known
> that's what I should do, if I were lacking the luxury of being told by
> one wiser than myself?

/usr/share/doc/initscripts-*/sysconfig.txt
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Florin Andrei
Dave wrote:
> 
> [r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
> # Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express
> DEVICE=eth0
> BOOTPROTO=none
> HWADDR=00:18:8b:0f:ad:c2
> IPADDR=1[snip]0
> ONBOOT=yes
> DHCP_HOSTNAME=[snip]
> DNS1=1[snip]0
> DNS2=1[snip].2
> NM_CONTROLLED=no
> SEARCH=[snip]
> NETMASK=255.255.255.0
> DNS3=1[snip]0
> GATEWAY=1[snip]0.1
> TYPE=Ethernet
> USERCTL=no
> PEERDNS=yes
> IPV6INIT=no

Holy cow, something put every single option in that file.
For static address, the minimum you need is this:

DEVICE=eth0
BOOTPROTO=none
HWADDR=00:18:8b:0f:ad:c2
IPADDR=1[snip]0
ONBOOT=yes
NETMASK=255.255.255.0
TYPE=Ethernet

And you can either leave GATEWAY there or put it in /etc/sysconfig/network

I assume it's because of PEERDNS=yes, and you'll have to try to be sure, 
but anyway all that junk serves no purpose there (well, arguably you 
could put back USERCTL and stuff like that, if you really need it).

-- 
Florin Andrei

http://florin.myip.org/

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 10:29 AM, Florin Andrei  wrote:
> What is the output of these commands?
>
> rpm -qa | grep dhc
> # to see what's actually installed as a package

 rpm -qa | grep dhc
dhcpv6-client-1.0.14-1.fc9.x86_64
libdhcp4client-4.0.0-22.fc9.x86_64
libdhcp6client-1.0.14-1.fc9.x86_64
libdhcp-1.99.8-1.fc9.x86_64
dhclient-4.0.0-22.fc9.x86_64


>
> find / -name dhclient
> # to see if and where is the executable installed

I hope this is an acceptable substitute:
 rpm -qfs /sbin/dhclient
normal/sbin/dhclient
normal/sbin/dhclient-script
normal/usr/share/doc/dhclient-4.0.0
normal/usr/share/doc/dhclient-4.0.0/dhclient.conf.sample
normal/usr/share/man/man5/dhclient.conf.5.gz
normal/usr/share/man/man5/dhclient.leases.5.gz
normal/usr/share/man/man5/dhcp-eval.5.gz
normal/usr/share/man/man5/dhcp-options.5.gz
normal/usr/share/man/man8/dhclient-script.8.gz
normal/usr/share/man/man8/dhclient.8.gz
normal/var/lib/dhclient


>
> grep -rI dhclient /etc | grep -v selinux | grep -v /ifup-eth: \
>        | grep -v /ifdown-eth:
> # to see if it's called from somewhere else than the regular places

Substituting:
 find /etc -type f -exec grep -iH dhclient {} \; | grep -v selinux
/etc/bluetooth/network.conf:Script=dhclient
/etc/rwtab:empty/var/lib/dhclient
/etc/resolv.conf.save:; generated by /sbin/dhclient-script
/etc/sysconfig/network-scripts/ifdown-eth:[ -n "`pidof -x dhclient`" ] && {
/etc/sysconfig/network-scripts/ifdown-eth:  if [ -f
"/var/run/dhclient-${DEVICE}.pid" ]; then
/etc/sysconfig/network-scripts/ifdown-eth:  dhcpid=`cat
/var/run/dhclient-${DEVICE}.pid`
/etc/sysconfig/network-scripts/ifdown-eth:
/sbin/dhclient -r -lf /var/lib/dhclient/dhclient-${DEVICE}.leases -pf
/var/run/dhclient-${DEVICE}.pid ${DEVICE} >/dev/null 2>&1
/etc/sysconfig/network-scripts/ifdown-eth:
reason=STOP interface=${DEVICE} /sbin/dhclient-script
/etc/sysconfig/network-scripts/ifdown-eth:  if [ -f
"/var/run/dhclient-${DEVICE}.pid" ]; then
/etc/sysconfig/network-scripts/ifdown-eth:  rm -f
/var/run/dhclient-${DEVICE}.pid
/etc/sysconfig/network-scripts/ifup-eth:if [ -n "${DYNCONFIG}" -a -x
/sbin/dhclient ]; then
/etc/sysconfig/network-scripts/ifup-eth:# Remove any temporary
references which were previously added to dhclient config
/etc/sysconfig/network-scripts/ifup-eth:if [ -w
/etc/dhclient-${DEVICE}.conf ] ; then
/etc/sysconfig/network-scripts/ifup-eth:LC_ALL=C grep -v "#
temporary RHL ifup addition" /etc/dhclient-${DEVICE}.conf >
/etc/dhclient-${DEVICE}.conf.ifupnew 2> /dev/null
/etc/sysconfig/network-scripts/ifup-eth:cat
/etc/dhclient-${DEVICE}.conf.ifupnew > /etc/dhclient-${DEVICE}.conf
/etc/sysconfig/network-scripts/ifup-eth:rm -f
/etc/dhclient-${DEVICE}.conf.ifupnew
/etc/sysconfig/network-scripts/ifup-eth:if [[
"${PERSISTENT_DHCLIENT}" =  [yY1]* ]]; then
/etc/sysconfig/network-scripts/ifup-eth:   if [ -w
/etc/dhclient-${DEVICE}.conf ] ; then
/etc/sysconfig/network-scripts/ifup-eth:   if ! LC_ALL=C grep
"send *host-name *\"${DHCP_HOSTNAME}\"" /etc/dhclient-${DEVICE}.conf >
/dev/null 2>&1 ; then
/etc/sysconfig/network-scripts/ifup-eth:   echo "send
host-name \"${DHCP_HOSTNAME}\";  # temporary RHL ifup addition" >>
/etc/dhclient-${DEVICE}.conf
/etc/sysconfig/network-scripts/ifup-eth:   elif ! [ -e
/etc/dhclient-${DEVICE}.conf ] ; then
/etc/sysconfig/network-scripts/ifup-eth:   echo "send
host-name \"${DHCP_HOSTNAME}\";  # temporary RHL ifup addition" >>
/etc/dhclient-${DEVICE}.conf
/etc/sysconfig/network-scripts/ifup-eth:# allow users to use
generic '/etc/dhclient.conf' (as documented in manpage!)
/etc/sysconfig/network-scripts/ifup-eth:if [ -s
/etc/dhclient-${DEVICE}.conf ]; then
/etc/sysconfig/network-scripts/ifup-eth:   DHCLIENTCONF="-cf
/etc/dhclient-${DEVICE}.conf";
/etc/sysconfig/network-scripts/ifup-eth:   DHCLIENTCONF='';
/etc/sysconfig/network-scripts/ifup-eth:if [ -f
/dev/.dhclient-${DEVICE}.leases ] ; then
/etc/sysconfig/network-scripts/ifup-eth:mv -f
/dev/.dhclient-${DEVICE}.leases
/var/lib/dhclient/dhclient-${DEVICE}.leases
/etc/sysconfig/network-scripts/ifup-eth:[ -x /sbin/restorecon
] && restorecon /var/lib/dhclient/dhclient-${DEVICE}.leases >
/dev/null 2>&1
/etc/sysconfig/network-scripts/ifup-eth:
DHCLIENTARGS="${DHCLIENTARGS} ${ONESHOT} -q ${DHCLIENTCONF} -lf
/var/lib/dhclient/dhclient-${DEVICE}.leases -pf
/var/run/dhclient-${DEVICE}.pid"
/etc/sysconfig/network-scripts/ifup-eth:if [[
"${PERSISTENT_DHCLIENT}" !=  [yY1]* ]] && check_link_down ${DEVICE};
then
/etc/sysconfig/network-scripts/ifup-eth:if /sbin/dhclient
${DHCLIENTARGS} ${DEVICE} ; then
/etc/sudoers:Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig,
/bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables,
/usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool


Script=dhclient looks interesting, 

Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 11:44 AM, Craig White  wrote:
> On Thu, 2009-10-08 at 11:19 -1000, Dave wrote:
>> [r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
[snip]
>> PEERDNS=yes
> - ^^^
> change to PEERDNS=no


What man page would tell me what this means? How should I have known
that's what I should do, if I were lacking the luxury of being told by
one wiser than myself?

rpm -qf /etc/sysconfig/network-scripts/ifcfg-eth0
file /etc/sysconfig/network-scripts/ifcfg-eth0 is not owned by any package
man ifcfg
No manual entry for ifcfg
man ifcfg-eth0
No manual entry for ifcfg-eth0

mahalo,
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Joseph L. Casale
>Yes, I know the docs. What I was saying is - it will not help finding
>the cause, which is what the OP requested. It will just make the problem
>go away.

Uhm, am I missing something? It *is* the cause?
Its designed to do just what it's doing, and here's a real shocker, it's doing 
it:)
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Craig White
On Thu, 2009-10-08 at 11:19 -1000, Dave wrote:
> On Thu, Oct 8, 2009 at 9:49 AM, Spiro Harvey  wrote:
> > chkconfig for dhclient too, and see what that results.
> 
> 
> [root@ ~]# chkconfig --list|grep  -e dh -e clie
> [root@ ~]#
> 
> >
> > Also, look at /etc/sysconfig/network-scripts/ifcfg-eth0.
> 
> 
> [r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
> # Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express
> DEVICE=eth0
> BOOTPROTO=none
> HWADDR=00:18:8b:0f:ad:c2
> IPADDR=1[snip]0
> ONBOOT=yes
> DHCP_HOSTNAME=[snip]
> DNS1=1[snip]0
> DNS2=1[snip].2
> NM_CONTROLLED=no
> SEARCH=[snip]
> NETMASK=255.255.255.0
> DNS3=1[snip]0
> GATEWAY=1[snip]0.1
> TYPE=Ethernet
> USERCTL=no
> PEERDNS=yes
- ^^^
change to PEERDNS=no

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Florin Andrei
Joseph L. Casale wrote:
>> aw, man :)
>>
>> This is not fixing the leaking faucet. It's hammering the water pipe
>> shut instead.
> 
> Huh, what r u talking about? This is the right way to do this.
> Check the deployment docs on network scripts.

Yes, I know the docs. What I was saying is - it will not help finding 
the cause, which is what the OP requested. It will just make the problem 
go away.

-- 
Florin Andrei

http://florin.myip.org/

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 11:27 AM, Meenoo Shivdasani  wrote:
> /etc/init.d/network calls /etc/sysconfig/network-scripts/ifup which
> calls /sbin/dhclient which calls /sbin/dhclient-script which
> overwrites your resolv.conf with the info it gets from the DHCP server
> on the network.


How would I find this out on my own? And it seems not to be correct.
At least, if /etc/sysconfig/network-scripts/ifup calls
/sbin/dhclient, it must use some indirection, as dhclient is not
mentioned in the script explicitly:

grep -i dhc /etc/sysconfig/network-scripts/ifup
if [ "${BOOTPROTO}" = "bootp" -o "${BOOTPROTO}" = "dhcp" ]; then


Why does it overwrite /etc/resolv.conf when the machine is not set to
use DHCP? The IP address etc. is set statically using
/usr/bin/system-config-network.

Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Meenoo Shivdasani
> You guessed right. But the question remains, what software is writing the 
> file?

/etc/init.d/network calls /etc/sysconfig/network-scripts/ifup which
calls /sbin/dhclient which calls /sbin/dhclient-script which
overwrites your resolv.conf with the info it gets from the DHCP server
on the network.

M
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 10:10 AM, Florin Andrei  wrote:
> What happens when you do this:
>
> grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-*


 grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-eth0:BOOTPROTO=none


Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 9:49 AM, Spiro Harvey  wrote:
> chkconfig for dhclient too, and see what that results.


[root@ ~]# chkconfig --list|grep  -e dh -e clie
[root@ ~]#

>
> Also, look at /etc/sysconfig/network-scripts/ifcfg-eth0.


[r...@lee1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:18:8b:0f:ad:c2
IPADDR=1[snip]0
ONBOOT=yes
DHCP_HOSTNAME=[snip]
DNS1=1[snip]0
DNS2=1[snip].2
NM_CONTROLLED=no
SEARCH=[snip]
NETMASK=255.255.255.0
DNS3=1[snip]0
GATEWAY=1[snip]0.1
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
IPV6INIT=no

>
> It's possible to have addresses "statically" assigned via DHCP based on
> MAC addresses. If resolv.conf is getting populated by dhclient, then
> I'm guessing the odds of you having a dhcp server on your network is
> good. :)

You guessed right. But the question remains, what software is writing the file?

> In all likelihood, you have a static IP assigned in your ifcfg-eth0,
> and the resolv.conf is being over-written by dhclient.

What is invoking dhclient, how do I find it?
 rpm -qR dhclient
/bin/bash
initscripts >= 6.75
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libc.so.6(GLIBC_2.8)(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(VersionedDependencies) <= 3.0.3-1
rtld(GNU_HASH)

Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Joseph L. Casale
>aw, man :)
>
>This is not fixing the leaking faucet. It's hammering the water pipe
>shut instead.

Huh, what r u talking about? This is the right way to do this.
Check the deployment docs on network scripts.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Florin Andrei
Dave wrote:
> My machine has a static IP, with dhcp and IPv6 disabled. Every time I
> reboot, some process rewrites /etc/resolv.conf, including a comment
> about dhcpclient.

Is that dhcpclient, or dhclient?

> The only package I have installed that shows up in
> "rpm -qa|grep -i dhcp" is dhcpv6-client-1.0.10-16.el5, and nothing in
> there is named dhcpclient.

What is the output of these commands?

rpm -qa | grep dhc
# to see what's actually installed as a package

find / -name dhclient
# to see if and where is the executable installed

grep -rI dhclient /etc | grep -v selinux | grep -v /ifup-eth: \
| grep -v /ifdown-eth:
# to see if it's called from somewhere else than the regular places

-- 
Florin Andrei

http://florin.myip.org/

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Florin Andrei
Clint Dilks wrote:
> 
> Try adding PEERDNS=no to /etc/sysconfig/network :)

aw, man :)

This is not fixing the leaking faucet. It's hammering the water pipe 
shut instead.

-- 
Florin Andrei

http://florin.myip.org/

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Florin Andrei
Dave wrote:
> My machine has a static IP, with dhcp and IPv6 disabled. Every time I
> reboot, some process rewrites /etc/resolv.conf, including a comment
> about dhcpclient. The only package I have installed that shows up in

What happens when you do this:

grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-*

-- 
Florin Andrei

http://florin.myip.org/

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Florin Andrei
Meenoo Shivdasani wrote:
> 
> One option would be to comment out the make_resolv_conf()  function in
> /sbin/dhclient-script.

That's the last-ditch solution. Never use it, unless everything else fails.

-- 
Florin Andrei

http://florin.myip.org/

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Clint Dilks
Dave wrote:
> On Thu, Oct 8, 2009 at 7:52 AM, Sergey Smirnov
>  wrote:
>   
>> Maybe it overwritten by NetworkManager?
>> 
>
> I almost wish.
>
> [root@ ~]# /etc/init.d/NetworkManager status
> NetworkManager is stopped
> [root@ ~]# chkconfig --list|grep Netw
> NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
>   
Hi

Try adding PEERDNS=no to /etc/sysconfig/network :)
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Spiro Harvey
> about dhcpclient. The only package I have installed that shows up in

It's called "dhclient", so searching for "dhcp" won't give you a hit on
that.

chkconfig for dhclient too, and see what that results.

Also, look at /etc/sysconfig/network-scripts/ifcfg-eth0.

It's possible to have addresses "statically" assigned via DHCP based on
MAC addresses. If resolv.conf is getting populated by dhclient, then
I'm guessing the odds of you having a dhcp server on your network is
good. :)

In all likelihood, you have a static IP assigned in your ifcfg-eth0,
and the resolv.conf is being over-written by dhclient.

-- 
Spiro Harvey  Knossos Networks Ltd
021-295-1923  www.knossos.net.nz


signature.asc
Description: PGP signature
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Joseph L. Casale
>I almost wish.

Add a PEERDNS=no to your ifcfg file.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
On Thu, Oct 8, 2009 at 7:52 AM, Sergey Smirnov
 wrote:
> Maybe it overwritten by NetworkManager?

I almost wish.

[root@ ~]# /etc/init.d/NetworkManager status
NetworkManager is stopped
[root@ ~]# chkconfig --list|grep Netw
NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Sergey Smirnov
Maybe it overwritten by NetworkManager?

On Thu, Oct 8, 2009 at 9:41 PM, Dave

> wrote:

> My machine has a static IP, with dhcp and IPv6 disabled. Every time I
> reboot, some process rewrites /etc/resolv.conf, including a comment
> about dhcpclient. The only package I have installed that shows up in
> "rpm -qa|grep -i dhcp" is dhcpv6-client-1.0.10-16.el5, and nothing in
> there is named dhcpclient.
>
> I'd like to figure out what software is rewriting this file and why.
> man 5 resolv.conf  and man resolver are unhelpful in this case. rpm
> reports /etc/resolv.conf is not owned by any package.
>
> At this point, I am as (or more) interested in pointers regarding how
> to find the answer as I am in the actual answer. Please teach me to
> fish.
>
> mahalo,
> Dave
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
Sergey Smirnov
email/xmpp: sergey.a.smir...@gmail.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Meenoo Shivdasani
On Thu, Oct 8, 2009 at 1:41 PM, Dave  wrote:
> My machine has a static IP, with dhcp and IPv6 disabled. Every time I
> reboot, some process rewrites /etc/resolv.conf, including a comment
> about dhcpclient. The only package I have installed that shows up in
> "rpm -qa|grep -i dhcp" is dhcpv6-client-1.0.10-16.el5, and nothing in
> there is named dhcpclient.

Looks like the dhclient script is still being called.

One option would be to comment out the make_resolv_conf()  function in
/sbin/dhclient-script.

M
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread MHR
On Thu, Oct 8, 2009 at 10:41 AM, Dave  wrote:
> My machine has a static IP, with dhcp and IPv6 disabled. Every time I
> reboot, some process rewrites /etc/resolv.conf, including a comment
> about dhcpclient. The only package I have installed that shows up in
> "rpm -qa|grep -i dhcp" is dhcpv6-client-1.0.10-16.el5, and nothing in
> there is named dhcpclient.
>

I don't know that answer, but one workaround would be to maintain a
backup copy of the file and initiate a late-boot service that replaces
the rewritten one with the backup if they don't match.

mhr
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] resolv.conf rewritten every reboot. How to figure out who and why?

2009-10-08 Thread Dave
My machine has a static IP, with dhcp and IPv6 disabled. Every time I
reboot, some process rewrites /etc/resolv.conf, including a comment
about dhcpclient. The only package I have installed that shows up in
"rpm -qa|grep -i dhcp" is dhcpv6-client-1.0.10-16.el5, and nothing in
there is named dhcpclient.

I'd like to figure out what software is rewriting this file and why.
man 5 resolv.conf  and man resolver are unhelpful in this case. rpm
reports /etc/resolv.conf is not owned by any package.

At this point, I am as (or more) interested in pointers regarding how
to find the answer as I am in the actual answer. Please teach me to
fish.

mahalo,
Dave
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos