Re: /etc/resolv.conf getting over written with dhcp

2012-06-20 Thread Varuna

Ian Lepore wrote:


Using the 'prepend' or 'supercede' keywords in /etc/dhclient.conf is
pretty much the standard way of handling a mix of static and dhcp
interfaces where the static config needs to take precedence.  I'm not
sure why you dismiss it as essentially good, but somehow not good
enough.  It's been working for me for years.

-- Ian

The issue that I had indicated that the issue with the /etc/resolv.conf is being 
caused by an error in /sbin/dhclient-script; hence, I am definitely not looking 
at solving the issue either with /etc/dhclient.conf or /etc/dhclient-exit-hooks 
configuration file.


BTW, resolver(5) / resolv.conf(5) does not mention the usage of 
/etc/dhclient-exit-hooks file to protect the earlier contents of 
/etc/resolv.conf file.  Will put this issue in the freebsd-doc mailing list.


With regards,
Varuna
Eudaemonic Systems
Simple, Specific  Insightful

IT Consultants, Continued Education  Systems Distribution
+91-88-92-47-62-63
http://www.eudaemonicsystems.net
http://enquiry.eudaemonicsystems.net

--
This email is confidential, and may be legally privileged.  If you
are not the intended recipient, you must not use or disseminate
this information in any format.  If you have received this email in
error, please do delete it along with copies of it existing in any
other format, and notify the sender immediately.  The sender of this
email believes it is virus free, and does not accept any liability
for any errors or omissions arising thereof.

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


/etc/resolv.conf getting over written with dhcp

2012-06-15 Thread Varuna
 out that 
/etc/resolv.conf has not changed? What are the checks made to see if /usr is not 
yet mounted. Not sure if the code; following the comment under 2***; how it 
behaves when the following is the output of mount:

   /dev/ad4s1a on / (ufs, local)
   devfs on /dev (devfs, local, multilabel)
   /dev/ad4s1f on /home (ufs, local, soft-updates)
   /dev/ad4s1d on /usr/ports (ufs, local, soft-updates)
   /dev/ad4s1e on /usr/src (ufs, local, soft-updates)
   procfs on /proc (procfs, local)
   linprocfs on /usr/compat/linux/proc (linprocfs, local)
Now I guess the code in 3*** should also be modified to check if the 
/usr/bin/cmp is available.


Would this be correct?

With regards,
Varuna
Eudaemonic Systems
Simple, Specific  Insightful

IT Consultants, Continued Education  Systems Distribution
+91-88-92-47-62-63
http://www.eudaemonicsystems.net
http://enquiry.eudaemonicsystems.net

--
This email is confidential, and may be legally privileged.  If you
are not the intended recipient, you must not use or disseminate
this information in any format.  If you have received this email in
error, please do delete it along with copies of it existing in any
other format, and notify the sender immediately.  The sender of this
email believes it is virus free, and does not accept any liability
for any errors or omissions arising thereof.



___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: /etc/resolv.conf getting over written with dhcp

2012-06-15 Thread Varuna

Thanks for the pointers.

Dima Panov wrote:

 From my /etc/dhclient.conf:

interface lagg0 {
send dhcp-lease-time 3600;
prepend domain-name-servers 127.0.0.1, 4.4.4.4, 8.8.8.8;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers;
require subnet-mask, domain-name-servers;
}

And result is /etc/resolv.conf:
# Generated by resolvconf
nameserver 127.0.0.1
nameserver 4.4.4.4
nameserver 8.8.8.8
nameserver 192.168.1.1
True indeed this will work and I did have a look at dhclient.conf(5) to setup 
the freebsd8:/etc/dhclient.conf.  This will still call /sbin/dhclient-script 
which will overwrite the configuration done to the /etc/resolv.conf each time 
the system power is recycled.  As per /usr/src/include/resolv.h, the MAXNS is by 
default set to 3; which the default configuration user will not be aware of as 
the entire focus will be on the ifconfig related flags in /etc/rc.conf.  BTW, 
the example indicated in dhclient.conf(5) has a typo which says 
/etc/dhclient-script instead of /sbin/dhclient-script, indeed the system does 
not fail if the typo exists in dhclient.conf.



Eugene Grosbein wrote:

There is simple solution: create file /etc/dhclient-enter-hooks
and override add_new_resolv_conf() there to do nothing:

add_new_resolv_conf() {
  return 0
}

Works just fine for my systems.
Indeed this is a good suggestion, and this is if the user is aware of what to 
look for and where in /sbin/dhclient-script it is documented.


A general sysadmin would be aware of /etc/nsswitch.conf and /etc/resolv.conf for 
name resolution issues and I do not think they will be aware of so many possible 
ways to handle the issue of resolv.conf getting overwritten by the usage of dhcp.


What would be the way out? Do you think it would be a good idea to push the 
nameserver configuration information into /etc/rc.conf which happens to be the 
single file that would handle the system configuration?


With regards,
Varuna
Eudaemonic Systems
Simple, Specific  Insightful

IT Consultants, Continued Education  Systems Distribution
+91-88-92-47-62-63
http://www.eudaemonicsystems.net
http://enquiry.eudaemonicsystems.net

--
This email is confidential, and may be legally privileged.  If you
are not the intended recipient, you must not use or disseminate
this information in any format.  If you have received this email in
error, please do delete it along with copies of it existing in any
other format, and notify the sender immediately.  The sender of this
email believes it is virus free, and does not accept any liability
for any errors or omissions arising thereof.


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org