Bug 12984

Summary: /etc/rc* does not contain any support for dhclient
Product: Base System Reporter: Remy Card <card>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Remy Card 1999-08-05 13:50:01 UTC
	3.2-RELEASE contains dhclient but the startup scripts (/etc/rc*) do
not include any support for it.  Thus, it is not possible to use DHCP to
set the IP address without modifying these scripts.

Fix: Apply the following patch that adds dhclient support in /etc/rc.network
and /etc/defaults/rc.conf.  This patch includes the changes made in the
current version of /etc/rc*.
Comment 1 jooji 1999-08-05 16:28:50 UTC
On Thu, 5 Aug 1999, Remy Card wrote:

> 	3.2-RELEASE contains dhclient but the startup scripts (/etc/rc*) do
> not include any support for it.  Thus, it is not possible to use DHCP to
> set the IP address without modifying these scripts.

Sure it is. /etc/rc.network looks for the file /etc/start_if.${ifn} for
each interface ${ifn} listed in rc.conf, and runs it if present. If you
want to use dhclient to lease an address on fxp0, for instance, make a
file /etc/start_if.fxp0 with the following lines in it:

    #!/bin/sh
    /sbin/dhclient fxp0

The patch looks okay, too, though. There's something appealing about being
able to simply stick ifconfig_fxp0="DHCP" in rc.conf, and not have to muck
with a start_if script. I'd suggest calling the new rc.conf variable
something like dhcpc_program, instead of just dhcp_program, to avoid
confusion with a possible future DHCP server program variable.

Cheers,
Mick
Comment 2 Doug 1999-08-05 18:46:46 UTC
On Thu, 5 Aug 1999, Remy Card wrote:

> 	3.2-RELEASE contains dhclient but the startup scripts (/etc/rc*) do
> not include any support for it.  Thus, it is not possible to use DHCP to
> set the IP address without modifying these scripts.

> 	Apply the following patch that adds dhclient support in /etc/rc.network
> and /etc/defaults/rc.conf.  This patch includes the changes made in the
> current version of /etc/rc*.

	While I agree that we need better support for dhcp in the rc*
scripts, I do not believe that your patch is the correct approach. There
are many things you can do with dhcp other than just ifconfig'ing an
interface, so the support needs to be more thorough than that. 

	For one approach on using the start_if* approach see
http://home.san.rr.com/freebsd/dhcp.html. I'm working on a more complete
approach for dhcp support, if you'd be willing to test what I come up with
send me a private e-mail and we can work something out. 

Doug
-- 
On account of being a democracy and run by the people, we are the only
nation in the world that has to keep a government four years, no matter
what it does.
                -- Will Rogers
Comment 3 nick.hibma 1999-08-12 09:13:27 UTC
---------- Forwarded message ----------
Date: 11 Aug 1999 14:41:38 -0400
From: Lowell Gilbert <lowell@world.std.com>
To: Nick Hibma <nick.hibma@jrc.it>
Subject: Re: conf/12984: No dhclient support in /etc/rc*

Nick Hibma <nick.hibma@jrc.it> writes:

>  >  with a start_if script. I'd suggest calling the new rc.conf variable
>  >  something like dhcpc_program, instead of just dhcp_program, to avoid
>  >  confusion with a possible future DHCP server program variable.
> 
> Making rc.conf depend on the version or make of the program is a bad
> idea. Specifying it at all is a bad thing as we have a dhcp client in
> the base distribution, so that should be used.

I'm not completely sure I understand the point of the first sentence,
but I don't see why this is any different than lpd, sendmail, portmap,
bind, and so on.  Given that there *are* alternatives, making it
possible to use them through the same mechanism as the system's
"stock" program seems quite reasonable.

 - Lowell
Comment 4 k 1999-12-13 20:50:15 UTC
Please close this PR since a similar patch has been commited to both
current and stable.

/K

--
Johan Karlsson          mailto:k@numeri.campus.luth.se
Comment 5 Steve Price freebsd_committer freebsd_triage 1999-12-17 20:36:32 UTC
State Changed
From-To: open->closed

A similar patch has already been committed to both -current and -stable.