For review: resolv ordering patch

Doug Barton dougb at FreeBSD.org
Thu May 31 21:50:20 UTC 2007


The attached patch makes resolv ordering deterministic, and places it
between netif and NETWORKING. It also tightens up the code a little
and fixes whitespace issues in resolv. I'm open to suggestions for
more precise ordering, but I'd like to get this in sooner than later,
and definitely before the freeze.

This is designed to fix the issue on RELENG_6 where resolv is not in
the early section before including local scripts, but is after (which
means that it never gets run).

Doug

-- 

    This .signature sanitized for your protection

-------------- next part --------------
diff -u /usr/src/etc/rc.d/NETWORKING ./NETWORKING
--- /usr/src/etc/rc.d/NETWORKING	Wed May 23 00:24:50 2007
+++ ./NETWORKING	Thu May 31 14:30:52 2007
@@ -6,7 +6,7 @@
 
 # PROVIDE: NETWORKING NETWORK
 # REQUIRE: netif netoptions routing network_ipv6 isdnd ppp
-# REQUIRE: routed mrouted route6d mroute6d
+# REQUIRE: routed mrouted route6d mroute6d resolv
 
 #	This is a dummy dependency, for services which require networking
 #	to be operational before starting.
diff -u /usr/src/etc/rc.d/resolv ./resolv
--- /usr/src/etc/rc.d/resolv	Sat Dec 10 12:21:45 2005
+++ ./resolv	Thu May 31 14:48:32 2007
@@ -28,6 +28,7 @@
 #
 
 # PROVIDE: resolv
+# REQUIRE: netif
 # KEYWORD: nojail
 
 . /etc/rc.subr
@@ -41,15 +42,15 @@
 #
 if [ ! -e /etc/resolv.conf -a \
     -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then
-	/bin/cat /dev/null > /etc/resolv.conf
+	> /etc/resolv.conf
 
 	if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then
 		echo domain `/bin/kenv dhcp.domain-name` > /etc/resolv.conf
 	fi
 
-        set -- `/bin/kenv dhcp.domain-name-servers`
-        for ns in `IFS=','; echo $*`; do
-                echo nameserver $ns >> /etc/resolv.conf;
-        done
+	set -- `/bin/kenv dhcp.domain-name-servers`
+	for ns in `IFS=','; echo $*`; do
+		echo nameserver $ns >> /etc/resolv.conf;
+	done
 fi
 


More information about the freebsd-rc mailing list