From nobody@FreeBSD.org  Tue Dec 19 08:15:48 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id DD91216A47C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Dec 2006 08:15:48 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5899B43CA4
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Dec 2006 08:15:48 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id kBJ8FbX2017683
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Dec 2006 08:15:37 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id kBJ8FbUN017682;
	Tue, 19 Dec 2006 08:15:37 GMT
	(envelope-from nobody)
Message-Id: <200612190815.kBJ8FbUN017682@www.freebsd.org>
Date: Tue, 19 Dec 2006 08:15:37 GMT
From: Dominic Fandrey<lon_kamikaze@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Suggest, setting nameservers in rc.conf
X-Send-Pr-Version: www-3.0

>Number:         106902
>Category:       conf
>Synopsis:       Suggest, setting nameservers in rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 19 08:20:17 GMT 2006
>Closed-Date:    Sat Dec 30 21:10:23 GMT 2006
>Last-Modified:  Sat Dec 30 21:10:23 GMT 2006
>Originator:     Dominic Fandrey
>Release:        Releng_6
>Organization:
private
>Environment:
FreeBSD mobileKamikaze.norad 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Sat Nov 25 12:55:14 CET 2006     root@homeKamikaze.norad:/usr/obj/TPR40-6/i386/usr/src/sys/TPR40-6  i386
>Description:
I find it useful to init my resolv.conf upon boot time, especially because it gets changed all the time on my notebook. And I'm not running a DHCP server at home. Maybe others find it useful as well. So here is my suggester rc script, called resolv.

I think the only change required to put it into base, would be to move the defaults into /etc/defaults/rc.conf.
>How-To-Repeat:

>Fix:
#!/bin/sh

# PROVIDE: resolv
# BEFORE: NETWORKING

: ${resolv_enable="NO"}
: ${resolv_nameserver=""}
: ${resolv_search=""}

. /etc/rc.subr

name="resolv"
rcvar=`set_rcvar`

resolv="/etc/resolv.conf"

resolv_start() {
	echo "# Nameservers set by resolv." > "$resolv"
	for nameserver in $resolv_nameserver; {
		echo "nameserver	$nameserver" >> "$resolv"
	}
	for search in $resolv_search; {
		echo "search	$search" >> "$resolv"
	}
}

start_cmd=resolv_start

load_rc_config $name
run_rc_command "$1"
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: remko 
Responsible-Changed-When: Tue Dec 19 09:19:28 UTC 2006 
Responsible-Changed-Why:  
This is something for the -rc team. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106902 
State-Changed-From-To: open->feedback 
State-Changed-By: dougb 
State-Changed-When: Wed Dec 20 18:23:07 UTC 2006 
State-Changed-Why:  

I don't see this as a generally useful idea, but perhaps you 
can say more about the conditions under which your resolv.conf 
changes, and why you need to rewrite it at boot time? 

Thanks, 

Doug 


Responsible-Changed-From-To: freebsd-rc->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Wed Dec 20 18:23:07 UTC 2006 
Responsible-Changed-Why:  

I'll manage the feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106902 

From: "[LoN]Kamikaze" <LoN_Kamikaze@gmx.de>
To: bug-followup@FreeBSD.org
Cc: Doug Barton <dougb@FreeBSD.org>,  freebsd-rc@FreeBSD.org
Subject: Re: misc/106902: Suggest, setting nameservers in rc.conf
Date: Wed, 20 Dec 2006 20:06:16 +0100

 Doug Barton wrote:
 > Synopsis: Suggest, setting nameservers in rc.conf
 > 
  > I don't see this as a generally useful idea, but perhaps you
 > can say more about the conditions under which your resolv.conf
 > changes, and why you need to rewrite it at boot time?
 > 
 > Thanks,
 > 
 > Doug
 
 While taking it around to other places I connect to different networks via wireless, so my rc.conf gets changed often by dhclient and vpnc. But at home I prefer to use cable LAN and there's no DHCP server running (it's a static network, no need for that). I can set the IP/subnet and the gateway in rc.conf, but I have to get the nameserver into the resolv.conf and there's simply not a convenient way to do this.
 If I'd make it read only, I wouldn't be able to use wireless any more. And I like the idea of having the network configuration in one place (rc.conf).
 Even if I want to reset it on runtime I only have to type
 # rcstart resolv
 (I'm using sysutils/bsdadminscripts), so for me it's a really just the most convenient way to reset the resolv.conf.

From: Doug Barton <dougb@FreeBSD.org>
To: "[LoN]Kamikaze" <LoN_Kamikaze@gmx.de>
Cc: bug-followup@FreeBSD.org,  freebsd-rc@FreeBSD.org
Subject: Re: misc/106902: Suggest, setting nameservers in rc.conf
Date: Wed, 20 Dec 2006 11:53:03 -0800

 [LoN]Kamikaze wrote:
 > Doug Barton wrote:
 >> Synopsis: Suggest, setting nameservers in rc.conf
 >>
 >  > I don't see this as a generally useful idea, but perhaps you
 >> can say more about the conditions under which your resolv.conf
 >> changes, and why you need to rewrite it at boot time?
 >>
 >> Thanks,
 >>
 >> Doug
 > 
 > While taking it around to other places I connect to different networks via wireless, so my rc.conf gets changed often by dhclient and vpnc. But at home I prefer to use cable LAN and there's no DHCP server running (it's a static network, no need for that). I can set the IP/subnet and the gateway in rc.conf, but I have to get the nameserver into the resolv.conf and there's simply not a convenient way to do this.
 > If I'd make it read only, I wouldn't be able to use wireless any more. And I like the idea of having the network configuration in one place (rc.conf).
 > Even if I want to reset it on runtime I only have to type
 > # rcstart resolv
 > (I'm using sysutils/bsdadminscripts), so for me it's a really just the most convenient way to reset the resolv.conf.
 > 
 
 If someone else chimes in and says, "Yes, that sounds like a really
 useful idea that I can see XYZ applications for" then I'd be likely to
 say let's go ahead and add it.
 
 Meanwhile, I have a similar situation, and what I do to fix it is use
 an /etc/rc.local script that looks like this:
 
 #!/bin/sh
 PATH=/bin:/usr/bin:/sbin
 export PATH
 for ip in `ifconfig | awk '/inet / {print $2}'`; do
         case "${ip}" in
         127.0.0.1|0.0.0.0) ;;
         <my home network>.*)	Do a bunch of stuff ;;
 	*)			Do other stuff ;;
 	esac
 done
 exit 0
 
 I obviously think rc.d is a great tool, but I don't think trying to
 shoehorn every system administration problem into it is a good idea.
 
 hth,
 
 Doug
 
 -- 
 
     This .signature sanitized for your protection
State-Changed-From-To: feedback->closed 
State-Changed-By: dougb 
State-Changed-When: Sat Dec 30 21:09:33 UTC 2006 
State-Changed-Why:  

No one else has spoken up indicating that this would be 
a generally useful idea, so we'll leave this in the 
archive for now.  

Doug 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106902 
>Unformatted:
