head	1.38;
access;
symbols
	RELENG_8_4:1.38.0.2
	RELENG_9_1_0_RELEASE:1.32.4.3.2.2
	RELENG_9_1:1.32.4.3.0.2
	RELENG_9_1_BP:1.32.4.3
	RELENG_8_3_0_RELEASE:1.32.2.3.2.1
	RELENG_8_3:1.32.2.3.0.2
	RELENG_8_3_BP:1.32.2.3
	RELENG_9_0_0_RELEASE:1.32.4.1.2.1
	RELENG_9_0:1.32.4.1.0.2
	RELENG_9_0_BP:1.32.4.1
	RELENG_9:1.32.0.4
	RELENG_9_BP:1.32
	RELENG_7_4_0_RELEASE:1.28.2.3.8.1
	RELENG_8_2_0_RELEASE:1.32.2.1.6.1
	RELENG_7_4:1.28.2.3.0.8
	RELENG_7_4_BP:1.28.2.3
	RELENG_8_2:1.32.2.1.0.6
	RELENG_8_2_BP:1.32.2.1
	RELENG_8_1_0_RELEASE:1.32.2.1.4.1
	RELENG_8_1:1.32.2.1.0.4
	RELENG_8_1_BP:1.32.2.1
	RELENG_7_3_0_RELEASE:1.28.2.3.6.1
	RELENG_7_3:1.28.2.3.0.6
	RELENG_7_3_BP:1.28.2.3
	RELENG_8_0_0_RELEASE:1.32.2.1.2.1
	RELENG_8_0:1.32.2.1.0.2
	RELENG_8_0_BP:1.32.2.1
	RELENG_8:1.32.0.2
	RELENG_8_BP:1.32
	RELENG_7_2_0_RELEASE:1.28.2.3.4.1
	RELENG_7_2:1.28.2.3.0.4
	RELENG_7_2_BP:1.28.2.3
	RELENG_7_1_0_RELEASE:1.28.2.3.2.1
	RELENG_6_4_0_RELEASE:1.20.2.7.2.1
	RELENG_7_1:1.28.2.3.0.2
	RELENG_7_1_BP:1.28.2.3
	RELENG_6_4:1.20.2.7.0.2
	RELENG_6_4_BP:1.20.2.7
	RELENG_7_0_0_RELEASE:1.28.4.1
	RELENG_6_3_0_RELEASE:1.20.2.4
	RELENG_7_0:1.28.0.4
	RELENG_7_0_BP:1.28
	RELENG_6_3:1.20.2.4.0.2
	RELENG_6_3_BP:1.20.2.4
	RELENG_7:1.28.0.2
	RELENG_7_BP:1.28
	RELENG_6_2_0_RELEASE:1.20.2.1
	RELENG_6_2:1.20.2.1.0.6
	RELENG_6_2_BP:1.20.2.1
	RELENG_5_5_0_RELEASE:1.16.2.1
	RELENG_5_5:1.16.2.1.0.6
	RELENG_5_5_BP:1.16.2.1
	RELENG_6_1_0_RELEASE:1.20.2.1
	RELENG_6_1:1.20.2.1.0.4
	RELENG_6_1_BP:1.20.2.1
	RELENG_6_0_0_RELEASE:1.20.2.1
	RELENG_6_0:1.20.2.1.0.2
	RELENG_6_0_BP:1.20.2.1
	RELENG_6:1.20.0.2
	RELENG_6_BP:1.20
	RELENG_5_4_0_RELEASE:1.16.2.1
	RELENG_5_4:1.16.2.1.0.4
	RELENG_5_4_BP:1.16.2.1
	RELENG_5_3_0_RELEASE:1.16.2.1
	RELENG_5_3:1.16.2.1.0.2
	RELENG_5_3_BP:1.16.2.1
	RELENG_5:1.16.0.2
	RELENG_5_BP:1.16
	RELENG_5_2_1_RELEASE:1.10
	RELENG_5_2_0_RELEASE:1.10
	RELENG_5_2:1.10.0.2
	RELENG_5_2_BP:1.10
	RELENG_5_1_0_RELEASE:1.4
	RELENG_5_1:1.4.0.2
	RELENG_5_1_BP:1.4
	RELENG_5_0_0_RELEASE:1.2
	RELENG_5_0:1.2.0.2
	RELENG_5_0_BP:1.2
	head_20020621:1.1.1.2
	head_20010615:1.1.1.1
	NETBSD:1.1.1;
locks; strict;
comment	@# @;


1.38
date	2012.11.17.01.49.04;	author svnexp;	state Exp;
branches
	1.38.2.1;
next	1.37;

1.37
date	2012.01.20.17.19.50;	author rea;	state Exp;
branches;
next	1.36;

1.36
date	2012.01.12.06.48.11;	author rea;	state Exp;
branches;
next	1.35;

1.35
date	2011.10.28.06.03.38;	author rea;	state Exp;
branches;
next	1.34;

1.34
date	2011.10.17.13.05.57;	author des;	state Exp;
branches;
next	1.33;

1.33
date	2011.10.13.17.20.45;	author des;	state Exp;
branches;
next	1.32;

1.32
date	2008.04.15.23.03.35;	author brooks;	state Exp;
branches
	1.32.2.1
	1.32.4.1;
next	1.31;

1.31
date	2008.02.01.23.43.58;	author brooks;	state Exp;
branches;
next	1.30;

1.30
date	2007.12.08.22.27.18;	author dougb;	state Exp;
branches;
next	1.29;

1.29
date	2007.12.08.07.20.22;	author dougb;	state Exp;
branches;
next	1.28;

1.28
date	2007.03.25.19.45.20;	author mtm;	state Exp;
branches
	1.28.2.1
	1.28.4.1;
next	1.27;

1.27
date	2007.03.02.20.48.35;	author brooks;	state Exp;
branches;
next	1.26;

1.26
date	2007.02.15.06.51.31;	author yar;	state Exp;
branches;
next	1.25;

1.25
date	2006.10.02.18.50.58;	author brooks;	state Exp;
branches;
next	1.24;

1.24
date	2006.08.17.19.57.10;	author brian;	state Exp;
branches;
next	1.23;

1.23
date	2006.08.17.17.12.26;	author brian;	state Exp;
branches;
next	1.22;

1.22
date	2006.07.09.06.54.24;	author stefanf;	state Exp;
branches;
next	1.21;

1.21
date	2005.07.26.00.37.19;	author brooks;	state Exp;
branches;
next	1.20;

1.20
date	2005.06.30.17.50.34;	author brooks;	state Exp;
branches
	1.20.2.1;
next	1.19;

1.19
date	2005.06.07.04.49.12;	author brooks;	state Exp;
branches;
next	1.18;

1.18
date	2005.01.16.03.12.03;	author obrien;	state Exp;
branches;
next	1.17;

1.17
date	2004.10.07.13.55.25;	author mtm;	state Exp;
branches;
next	1.16;

1.16
date	2004.05.20.14.16.04;	author mtm;	state Exp;
branches
	1.16.2.1;
next	1.15;

1.15
date	2004.03.08.12.25.05;	author pjd;	state Exp;
branches;
next	1.14;

1.14
date	2004.03.05.07.43.38;	author mtm;	state Exp;
branches;
next	1.13;

1.13
date	2004.02.29.01.42.47;	author green;	state Exp;
branches;
next	1.12;

1.12
date	2004.01.17.10.40.45;	author mtm;	state Exp;
branches;
next	1.11;

1.11
date	2004.01.17.10.16.38;	author mtm;	state Exp;
branches;
next	1.10;

1.10
date	2003.09.16.02.56.13;	author mbr;	state Exp;
branches;
next	1.9;

1.9
date	2003.07.28.08.15.52;	author mbr;	state Exp;
branches;
next	1.8;

1.8
date	2003.07.26.18.58.46;	author mtm;	state Exp;
branches;
next	1.7;

1.7
date	2003.07.26.18.50.53;	author mtm;	state Exp;
branches;
next	1.6;

1.6
date	2003.06.29.05.34.41;	author mtm;	state Exp;
branches;
next	1.5;

1.5
date	2003.06.07.10.31.17;	author mtm;	state Exp;
branches;
next	1.4;

1.4
date	2003.04.20.19.14.16;	author mtm;	state Exp;
branches;
next	1.3;

1.3
date	2003.04.18.17.53.02;	author mtm;	state Exp;
branches;
next	1.2;

1.2
date	2002.06.13.22.14.36;	author gordon;	state Exp;
branches;
next	1.1;

1.1
date	2001.06.16.07.16.14;	author obrien;	state Exp;
branches
	1.1.1.1;
next	;

1.38.2.1
date	2012.11.17.01.49.04;	author svnexp;	state dead;
branches;
next	1.38.2.2;

1.38.2.2
date	2013.03.28.13.02.43;	author svnexp;	state Exp;
branches;
next	;

1.32.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.32.2.1.2.1
	1.32.2.1.4.1
	1.32.2.1.6.1;
next	1.32.2.2;

1.32.2.2
date	2012.02.09.14.16.40;	author bapt;	state Exp;
branches;
next	1.32.2.3;

1.32.2.3
date	2012.02.14.12.47.57;	author des;	state Exp;
branches
	1.32.2.3.2.1;
next	1.32.2.4;

1.32.2.4
date	2012.11.17.10.35.56;	author svnexp;	state Exp;
branches;
next	;

1.32.2.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.32.2.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.32.2.1.6.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.32.2.3.2.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.32.2.3.2.2;

1.32.2.3.2.2
date	2012.11.17.08.24.38;	author svnexp;	state Exp;
branches;
next	;

1.32.4.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.32.4.1.2.1;
next	1.32.4.2;

1.32.4.2
date	2012.02.09.14.16.00;	author bapt;	state Exp;
branches;
next	1.32.4.3;

1.32.4.3
date	2012.02.14.12.43.33;	author des;	state Exp;
branches
	1.32.4.3.2.1;
next	1.32.4.4;

1.32.4.4
date	2012.11.17.11.36.11;	author svnexp;	state Exp;
branches;
next	;

1.32.4.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.32.4.1.2.2;

1.32.4.1.2.2
date	2012.11.17.08.36.11;	author svnexp;	state Exp;
branches;
next	;

1.32.4.3.2.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.32.4.3.2.2;

1.32.4.3.2.2
date	2012.11.17.08.47.01;	author svnexp;	state Exp;
branches;
next	;

1.28.2.1
date	2008.01.28.07.55.44;	author dougb;	state Exp;
branches;
next	1.28.2.2;

1.28.2.2
date	2008.03.12.17.35.38;	author brooks;	state Exp;
branches;
next	1.28.2.3;

1.28.2.3
date	2008.05.15.01.53.09;	author brooks;	state Exp;
branches
	1.28.2.3.2.1
	1.28.2.3.4.1
	1.28.2.3.6.1
	1.28.2.3.8.1;
next	1.28.2.4;

1.28.2.4
date	2012.11.17.08.01.20;	author svnexp;	state Exp;
branches;
next	;

1.28.2.3.2.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.28.2.3.4.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.28.2.3.6.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.28.2.3.8.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.28.2.3.8.2;

1.28.2.3.8.2
date	2012.11.17.08.16.37;	author svnexp;	state Exp;
branches;
next	;

1.28.4.1
date	2008.01.28.07.58.31;	author dougb;	state Exp;
branches;
next	;

1.20.2.1
date	2005.07.29.23.36.28;	author brooks;	state Exp;
branches;
next	1.20.2.2;

1.20.2.2
date	2007.01.09.03.29.49;	author brooks;	state Exp;
branches;
next	1.20.2.3;

1.20.2.3
date	2007.02.09.03.11.31;	author brooks;	state Exp;
branches;
next	1.20.2.4;

1.20.2.4
date	2007.03.10.14.07.01;	author yar;	state Exp;
branches;
next	1.20.2.5;

1.20.2.5
date	2008.01.28.08.22.32;	author dougb;	state Exp;
branches;
next	1.20.2.6;

1.20.2.6
date	2008.03.12.17.41.37;	author brooks;	state Exp;
branches;
next	1.20.2.7;

1.20.2.7
date	2008.05.15.01.53.46;	author brooks;	state Exp;
branches
	1.20.2.7.2.1;
next	1.20.2.8;

1.20.2.8
date	2012.11.17.07.39.07;	author svnexp;	state Exp;
branches;
next	;

1.20.2.7.2.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.16.2.1
date	2004.10.10.09.50.53;	author mtm;	state Exp;
branches;
next	;

1.1.1.1
date	2001.06.16.07.16.14;	author obrien;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2002.06.21.19.07.21;	author obrien;	state Exp;
branches;
next	;


desc
@@


1.38
log
@Switching exporter and resync
@
text
@#!/bin/sh
#
# $FreeBSD: head/etc/rc.d/dhclient 230388 2012-01-20 17:19:50Z rea $
#

# PROVIDE: dhclient
# KEYWORD: nojail nostart

. /etc/rc.subr
. /etc/network.subr

ifn="$2"

name="dhclient"
rcvar=
pidfile="/var/run/${name}.${ifn}.pid"
start_precmd="dhclient_prestart"
stop_precmd="dhclient_pre_check"

# rc_force check can only be done at the run_rc_command
# time, so we're testing it in the pre* hooks.
dhclient_pre_check()
{
	if [ -z "${rc_force}" ] && ! dhcpif $ifn; then
		local msg
		msg="'$ifn' is not a DHCP-enabled interface"
		if [ -z "${rc_quiet}" ]; then
			echo "$msg"
		else
			debug "$msg"
		fi
			exit 1
	fi
}

dhclient_prestart()
{
	dhclient_pre_check

	# Interface-specific flags (see rc.subr for $flags setting)
	specific=$(get_if_var $ifn dhclient_flags_IF)
	if [ -z "$flags" -a -n "$specific" ]; then
		rc_flags=$specific
	fi

	background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient)
	if checkyesno background_dhclient; then
		rc_flags="${rc_flags} -b"
	fi

	rc_flags="${rc_flags} ${ifn}"
}

load_rc_config $name
load_rc_config network

if [ -z $ifn ] ; then
	# only complain if a command was specified but no interface
	if [ -n "$1" ] ; then
		err 1 "$0: no interface specified"
	fi
fi

run_rc_command "$1"
@


1.38.2.1
log
@file dhclient was added on branch RELENG_8_4 on 2013-03-28 13:02:43 +0000
@
text
@d1 64
@


1.38.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 64
#!/bin/sh
#
# $FreeBSD: releng/8.4/etc/rc.d/dhclient 231677 2012-02-14 12:47:57Z des $
#

# PROVIDE: dhclient
# KEYWORD: nojail nostart

. /etc/rc.subr
. /etc/network.subr

ifn="$2"

name="dhclient"
rcvar=
pidfile="/var/run/${name}.${ifn}.pid"
start_precmd="dhclient_prestart"
stop_precmd="dhclient_pre_check"

# rc_force check can only be done at the run_rc_command
# time, so we're testing it in the pre* hooks.
dhclient_pre_check()
{
	if [ -z "${rc_force}" ] && ! dhcpif $ifn; then
		local msg
		msg="'$ifn' is not a DHCP-enabled interface"
		if [ -z "${rc_quiet}" ]; then
			echo "$msg"
		else
			debug "$msg"
		fi
			exit 1
	fi
}

dhclient_prestart()
{
	dhclient_pre_check

	# Interface-specific flags (see rc.subr for $flags setting)
	specific=$(get_if_var $ifn dhclient_flags_IF)
	if [ -z "$flags" -a -n "$specific" ]; then
		rc_flags=$specific
	fi

	background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient)
	if checkyesno background_dhclient; then
		rc_flags="${rc_flags} -b"
	fi

	rc_flags="${rc_flags} ${ifn}"
}

load_rc_config $name
load_rc_config network

if [ -z $ifn ] ; then
	# only complain if a command was specified but no interface
	if [ -n "$1" ] ; then
		err 1 "$0: no interface specified"
	fi
fi

run_rc_command "$1"
@


1.37
log
@SVN rev 230388 on 2012-01-20 17:19:50Z by rea

dhclient: don't use syslog for logging non-DHCP interface errors

We should show the error to user, but it doesn't deserve syslog.

Approved by: jhb
@
text
@d3 1
a3 1
# $FreeBSD$
@


1.36
log
@SVN rev 230007 on 2012-01-12 06:48:11Z by rea

rc.d: document 'quiet' prefix and fix dhclient/devd interaction

Document the current semantics of the 'quiet' command prefix
in the rc.subr(8).

Fix dhclient rc.d script: it should not call err() for
non-DHCP-enabled interface when it is called from devd, because the
latter just blindly calls 'service dhclient quietstart' on each "link
up" event.

Since the 'quietstart' will silence the message "Cannot 'start' <foo>.
Set <foo>_enable to YES in /etc/rc.conf or use 'onestart' instead of
'start'." and running dhclient on the non-DHCP-enabled interface is
the same thing as running the service <foo> without <foo>_enable set,
such modification is in sync with the current semantics of the 'quiet'
prefix.

Approved by: glebius
Reviewed by: freebsd-rc list
MFC after:	2 weeks
@
text
@d28 1
a28 1
			err 1 "$msg"
d31 1
a32 1
		fi
@


1.35
log
@SVN rev 226879 on 2011-10-28 06:03:38Z by rea

Fix handling of rc_force in /etc/rc.d/dhclient

Variable 'rc_force' is accessible only at the time of rc_run_command,
so it can't be examined from the script's main code.

Spotted by:	hrs
Reviewed by:	hrs, des
Approved by:	des
MFC after:	2 weeks
@
text
@d25 8
a32 1
		err 1 "'$ifn' is not a DHCP-enabled interface"
@


1.34
log
@SVN rev 226464 on 2011-10-17 13:05:57Z by des

The rc_force test was inverted in the previous commit, so that dhclient ran
for interfaces which were not configured for DHCP *unless* rc_force was set;
the correct logic is to run dhclient for those interfaces *only if* rc_force
is set.

Broken by:	des@@
Noticed by:	everybody and his dog
Submitted by:	rea@@
PR:		bin/161733
@
text
@d18 10
d31 2
d53 1
a53 2
		echo 1>&2 "$0: no interface specified"
		return 1
a54 2
elif [ -z "${rc_force}" ] && ! dhcpif $ifn; then
	return 1
@


1.33
log
@SVN rev 226345 on 2011-10-13 17:20:45Z by des

Make dhclient use a pid file.  Modify the rc script accordingly; while
there, clean it up and add some error checks.

Glanced at by:	brooks@@
MFC after:	3 weeks
@
text
@d44 1
a44 1
elif [ -n "${rc_force}" ] && ! dhcpif $ifn; then
@


1.32
log
@Add very limited support for the isc-dhclient.  It will almostly certaintly
only work if there's just one interface doing dhcp.  This version implements
the same logic as the version in the PR, but uses pgrep to be less verbose.

PR:		conf/95905
MFC after:	1 week
@
text
@d12 2
d16 2
a17 2
start_cmd="dhclient_start"
stop_cmd="dhclient_stop"
d19 1
a19 1
dhclient_start()
d21 2
a22 19
	# prevent unnecessary restarts
	# XXX: dhclient had better create a pidfile
	if [ -x /bin/pgrep ]; then
		pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
		if [ -n "$pids" ]; then
			sleep 1
			pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
			if [ -n "$pids" ]; then
				exit 0
			fi
		elif [ -e /var/run/dhclient.pid ]; then
			if [ -n "`pgrep -F /var/run/dhclient.pid`" ]; then
				exit 0
			fi
		fi
	fi

	# Override for $ifn specific flags (see rc.subr for $flags setting)
	specific=`get_if_var $ifn dhclient_flags_IF`
d27 1
a27 1
	background_dhclient=`get_if_var $ifn background_dhclient_IF $background_dhclient`
d32 1
a32 6
	${dhclient_program} ${rc_flags} $ifn
}

dhclient_stop()
{
	ifconfig $ifn down	# cause dhclient to die
a34 2
ifn="$2"

d38 7
a44 1
if ! dhcpif $ifn; then
@


1.32.4.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.32.4.2
log
@SVN rev 231277 on 2012-02-09 14:16:00Z by bapt

MFH r226345, r226464, r226879:
Make dhclient use a pid file. Modify the rc script accordingly, fix some bugs

Approved by:	des (mentor)
@
text
@a11 2
ifn="$2"

d14 4
a17 7
pidfile="/var/run/${name}.${ifn}.pid"
start_precmd="dhclient_prestart"
stop_precmd="dhclient_pre_check"

# rc_force check can only be done at the run_rc_command
# time, so we're testing it in the pre* hooks.
dhclient_pre_check()
d19 15
a33 2
	if [ -z "${rc_force}" ] && ! dhcpif $ifn; then
		err 1 "'$ifn' is not a DHCP-enabled interface"
a34 5
}

dhclient_prestart()
{
	dhclient_pre_check
d36 2
a37 2
	# Interface-specific flags (see rc.subr for $flags setting)
	specific=$(get_if_var $ifn dhclient_flags_IF)
d42 1
a42 1
	background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient)
d47 1
a47 1
	rc_flags="${rc_flags} ${ifn}"
d50 7
d60 2
a61 5
if [ -z $ifn ] ; then
	# only complain if a command was specified but no interface
	if [ -n "$1" ] ; then
		err 1 "$0: no interface specified"
	fi
@


1.32.4.3
log
@SVN rev 231676 on 2012-02-14 12:43:33Z by des

MFH r230007, r230388: document quiet*, fix devd/dhclient interaction.
@
text
@d25 1
a25 8
		local msg
		msg="'$ifn' is not a DHCP-enabled interface"
		if [ -z "${rc_quiet}" ]; then
			echo "$msg"
		else
			debug "$msg"
		fi
			exit 1
@


1.32.4.4
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d3 1
a3 1
# $FreeBSD: stable/9/etc/rc.d/dhclient 231676 2012-02-14 12:43:33Z des $
@


1.32.4.3.2.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.32.4.3.2.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/9.1/etc/rc.d/dhclient 231676 2012-02-14 12:43:33Z des $
@


1.32.4.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.32.4.1.2.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/9.0/etc/rc.d/dhclient 178233 2008-04-15 23:03:35Z brooks $
@


1.32.2.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.32.2.2
log
@SVN rev 231278 on 2012-02-09 14:16:40Z by bapt

MFH r226345, r226464, r226879:
Make dhclient use a pid file. Modify the rc script accordingly, fix some bugs

Approved by:	des (mentor)
@
text
@a11 2
ifn="$2"

d14 4
a17 7
pidfile="/var/run/${name}.${ifn}.pid"
start_precmd="dhclient_prestart"
stop_precmd="dhclient_pre_check"

# rc_force check can only be done at the run_rc_command
# time, so we're testing it in the pre* hooks.
dhclient_pre_check()
d19 15
a33 2
	if [ -z "${rc_force}" ] && ! dhcpif $ifn; then
		err 1 "'$ifn' is not a DHCP-enabled interface"
a34 5
}

dhclient_prestart()
{
	dhclient_pre_check
d36 2
a37 2
	# Interface-specific flags (see rc.subr for $flags setting)
	specific=$(get_if_var $ifn dhclient_flags_IF)
d42 1
a42 1
	background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient)
d47 1
a47 1
	rc_flags="${rc_flags} ${ifn}"
d50 7
d60 2
a61 5
if [ -z $ifn ] ; then
	# only complain if a command was specified but no interface
	if [ -n "$1" ] ; then
		err 1 "$0: no interface specified"
	fi
@


1.32.2.3
log
@SVN rev 231677 on 2012-02-14 12:47:57Z by des

MFH r230007, r230388: document quiet*, fix devd/dhclient interaction.
@
text
@d25 1
a25 8
		local msg
		msg="'$ifn' is not a DHCP-enabled interface"
		if [ -z "${rc_quiet}" ]; then
			echo "$msg"
		else
			debug "$msg"
		fi
			exit 1
@


1.32.2.4
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d3 1
a3 1
# $FreeBSD: stable/8/etc/rc.d/dhclient 231677 2012-02-14 12:47:57Z des $
@


1.32.2.3.2.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.32.2.3.2.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/8.3/etc/rc.d/dhclient 231677 2012-02-14 12:47:57Z des $
@


1.32.2.1.6.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.32.2.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.32.2.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.31
log
@When the state of the interface changes rapidly enough (usually due to
rapid wireless association changes in my experience), there is a race
where dhclient is in the process of exiting due to the link going down
when the link coming up causes devd to try and start a new one.  This
results is the link being up, but no dhclient running.

Work around this race by checking a second time after a one second delay
before refusing to start a dhclient instance due to one already being
running.

MFC after:	1 week
@
text
@d29 4
@


1.30
log
@Remove spurious # marks to be more consistent with existing style.
@
text
@d24 5
a28 1
			exit 0
@


1.29
log
@Remove $NetBSD$ CVS tags. We no longer attempt to synch our rc.d files
with theirs, so this information doesn't need to be in the live file.
Having it in our CVS history is enough.
@
text
@a7 1
#
@


1.28
log
@Having gone to the trouble of setting up a variable, we should use it.
@
text
@a2 1
# $NetBSD: dhclient,v 1.8 2002/03/22 04:33:58 thorpej Exp $
@


1.28.4.1
log
@MFC the purely cosmetic changes, including removal of $NetBSD$ Ids,
a few spurious #'s, an empty REQUIRE, and a never-used KEYWORD.

Approved by:	re (kensmith)
@
text
@d3 1
d9 1
@


1.28.2.1
log
@MFC the purely cosmetic changes, including removal of $NetBSD$ Ids,
a few spurious #'s, an empty REQUIRE, and a never-used KEYWORD.
@
text
@d3 1
d9 1
@


1.28.2.2
log
@MFC rev 1.31:

When the state of the interface changes rapidly enough there is a race
where dhclient is in the process of exiting due to the link going down
when the link coming up causes devd to try and start a new one.  This
results is the link being up, but no dhclient running.

Work around this race by checking a second time after a one second delay
before refusing to start a dhclient instance due to one already being
running.
@
text
@d24 1
a24 5
			sleep 1
			pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
			if [ -n "$pids" ]; then
				exit 0
			fi
@


1.28.2.3
log
@MFC: Add very limited support for the isc-dhclient. It will almostly certaintly
only work if there's just one interface doing dhcp. This version implements
the same logic as the version in the PR, but uses pgrep to be less verbose.

PR:		conf/95905
@
text
@a28 4
		elif [ -e /var/run/dhclient.pid ]; then
			if [ -n "`pgrep -F /var/run/dhclient.pid`" ]; then
				exit 0
			fi
@


1.28.2.4
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: stable/7/etc/rc.d/dhclient 179006 2008-05-15 01:53:46Z brooks $
@


1.28.2.3.8.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.28.2.3.8.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/7.4/etc/rc.d/dhclient 179006 2008-05-15 01:53:46Z brooks $
@


1.28.2.3.6.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.28.2.3.4.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.28.2.3.2.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.27
log
@Use get_if_var() to retrieve interface specific values of dhclient_flags
and background_dhclient.  This allows interfaces who's names are not
valid parts of shell variables and shortens the code.

MFC after:	1 week
@
text
@d37 1
a37 1
	if checkyesno background_dhclient_$ifn; then
@


1.26
log
@pkill(1) and pgrep(1) have been moved to /bin so that they are
available to rc.d scripts early in the boot sequence.
@
text
@d31 1
a31 1
	eval specific=\$dhclient_flags_$ifn
d36 2
a37 6
	eval specific=\$background_dhclient_$ifn
	if [ -n "$specific" ]; then
		if checkyesno background_dhclient_$ifn; then
			rc_flags="${rc_flags} -b"
		fi
	elif checkyesno background_dhclient; then
@


1.25
log
@Pull in /etc/rc.conf.d/network so that ifconfig_<if> variables can be
set there.  This is required for consistency with /etc/rc.d/netif.

PR:		conf/103893
Submitted by:	Nick Hibma <nick at anywi.com>
MFC after:	3 days
@
text
@d22 3
a24 3
	# XXX: should use a pidfile
	if [ -x /usr/bin/pgrep ]; then
		pids=`/usr/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
@


1.24
log
@Add a missing quote

Spotted by: ru
@
text
@d56 1
@


1.23
log
@Add a -p switch to dhclient.  The switch tells dhclient to persist
despite the interface link status.

Add dhclient_flags_iface and background_dhclient_iface rc.conf options.
(where iface is a specific interface).  These can be used to give
interface specific flags to dhclient.

Reviewed by:	brooks@@
@
text
@d37 1
a37 1
	if [ -n "$specific ]; then
@


1.22
log
@Fix spelling in a comment.
@
text
@d30 12
a41 1
	if checkyesno background_dhclient; then
@


1.21
log
@Silence the de-bouncing of dhclient start up.  The previous output
caused significant mental anguish for some portions of the user
population. :)
@
text
@d21 1
a21 1
	# prevent unnecessicary restarts
@


1.20
log
@Remove REQUIRE and BEFORE lines since this script is not run by rcorder
at startup.  Instead it is called by other scripts.

Approved by:	re (network interface startup blanket)
@
text
@a25 1
			echo "${name} ${ifn}: already running?"
@


1.20.2.1
log
@Sync dhclient with HEAD:

 - Don't complain when debouncing dhclient startup.
 - Fix buffer handling in reveive_packet().  This fixes infinite cpu
   eating loops and probably some crashes.
 - Spell if_defaultroute route correctly in dhclient-script so we
   are allowed to change the default route.
 - Document dhclient -b.
 - Treat reassociation like association.
 - Do not force server-name to be a valid domain name.
 - Handle servers that send NUL-terminated host-name options.

Approved by:	re (scottl)
@
text
@d26 1
@


1.20.2.2
log
@MFC rev 1.25:
Pull in /etc/rc.conf.d/network so that ifconfig_<if> variables can be
set there. This is required for consistency with /etc/rc.d/netif.

PR:		conf/103893
Submitted by:	Nick Hibma <nick at anywi.com>
@
text
@a44 1
load_rc_config network
@


1.20.2.3
log
@Sync dhclient and supporting code with CURRENT.  In particular:
 - Introduce per-interface dhclient_flags_<ifn> and
   background_dhclient_<ifn> rc.conf variables.
 - Default to sending a client identifer.
 - When an invalid host name option is sent, delete it and accept the
   lease.
 - Fix usage, the call to getopt, and a typo in rc.d/dhclient.
@
text
@d21 1
a21 1
	# prevent unnecessary restarts
d30 1
a30 12
	# Override for $ifn specific flags (see rc.subr for $flags setting)
	eval specific=\$dhclient_flags_$ifn
	if [ -z "$flags" -a -n "$specific" ]; then
		rc_flags=$specific
	fi

	eval specific=\$background_dhclient_$ifn
	if [ -n "$specific" ]; then
		if checkyesno background_dhclient_$ifn; then
			rc_flags="${rc_flags} -b"
		fi
	elif checkyesno background_dhclient; then
@


1.20.2.4
log
@MFC rev. 1.26:

pkill(1) and pgrep(1) have been moved to /bin so that they are
available to rc.d scripts early in the boot sequence.
@
text
@d22 3
a24 3
	# XXX: dhclient had better create a pidfile
	if [ -x /bin/pgrep ]; then
		pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
@


1.20.2.5
log
@MFC the purely cosmetic changes, including removal of $NetBSD$ Ids,
a few spurious #'s, an empty REQUIRE, and a never-used KEYWORD.
@
text
@d3 1
d9 1
@


1.20.2.6
log
@Sync with current merging revs 1.27 and 1.31.

1.27:
Use get_if_var() to retrieve interface specific values of dhclient_flags
and background_dhclient.  This allows interfaces who's names are not
valid parts of shell variables and shortens the code.

1.31:
When the state of the interface changes rapidly enough there is a race
where dhclient is in the process of exiting due to the link going down
when the link coming up causes devd to try and start a new one.  This
results is the link being up, but no dhclient running.

Work around this race by checking a second time after a one second delay
before refusing to start a dhclient instance due to one already being
running.
@
text
@d24 1
a24 5
			sleep 1
			pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
			if [ -n "$pids" ]; then
				exit 0
			fi
d29 1
a29 1
	specific=`get_if_var $ifn dhclient_flags_IF`
d34 6
a39 2
	background_dhclient=`get_if_var $ifn background_dhclient_IF $background_dhclient`
	if checkyesno background_dhclient; then
@


1.20.2.7
log
@MFC: Add very limited support for the isc-dhclient. It will almostly certaintly
only work if there's just one interface doing dhcp. This version implements
the same logic as the version in the PR, but uses pgrep to be less verbose.

PR:		conf/95905
@
text
@a28 4
		elif [ -e /var/run/dhclient.pid ]; then
			if [ -n "`pgrep -F /var/run/dhclient.pid`" ]; then
				exit 0
			fi
@


1.20.2.8
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: stable/6/etc/rc.d/dhclient 179006 2008-05-15 01:53:46Z brooks $
@


1.20.2.7.2.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.19
log
@Support code for the OpenBSD dhclient.  This significantly changes the
way interfaces are configured.  Some key points:

  - At startup, all interfaces are configured through /etc/rc.d/netif.
  - ifconfig_<if> variables my now mix real ifconfig commands the with
    DHCP and WPA directives.  For example, this allows media
    configuration prior to running dhclient.
  - /etc/rc.d/dhclient is not run at startup except by netif to start
    dhclient on specific interfaces.
  - /etc/pccard_ether calls "/etc/rc.d/netif start <if>" to do most of
    it's work.
  - /etc/pccard_ether no longer takes additional arguments to pass to
    ifconfig.  Instead, ifconfig_<if> variables are now honored in favor
    of pccard_ifconfig when available.
  - /etc/pccard_ether will only run on interfaces specified in
    removable_interfaces, even if pccard_ifconfig is set.
@
text
@a7 2
# REQUIRE: netif ipfw ipfilter mountcritlocal cleanvar
# BEFORE:  NETWORKING
@


1.18
log
@"REQUIRE: cleanvar" for all RC's writing into /var/run.
@
text
@d10 1
a10 4
# KEYWORD: nojail
#
#	Note that there no syslog logging of dhclient messages at boot because
#	dhclient needs to start before services that syslog depends upon do.
d18 2
a19 5
pidfile="/var/run/${name}.pid"
start_precmd="dhclient_prestart"
start_postcmd="dhclient_poststart"
stop_precmd="dhclient_prestop"
stop_postcmd="dhclient_poststop"
d21 1
a21 1
dhclient_common()
d23 7
a29 12
	dhcp_list="`list_net_interfaces dhcp`"
	if [ -z "$dhcp_list" ]; then
		return 1
	fi

	# Determine the scope of the command
	#
	_cooked_list="$dhcp_list"
	if [ -n "$_cmdifn" ]; then
		eval _cooked_list=\"`expr "$dhcp_list" : ".*\($_cmdifn\).*"`\"
		if [ -z "$_cooked_list" ]; then
			err 1 "No such network interface: $_cmdifn"
a31 10
}

dhclient_prestart()
{
	if [ $dhclient_common_error -eq 1 ]; then
		return 1
	fi
	for ifn in ${_cooked_list}; do
		ifscript_up ${ifn}
	done
d34 1
a34 1
		rc_flags="${rc_flags} -nw"
d37 1
a37 2
	rc_flags="${rc_flags} ${_cooked_list}"
	return 0
d40 1
a40 1
dhclient_poststart()
d42 1
a42 5
	for ifn in ${_cooked_list}; do
		ifalias_up ${ifn}
		ipx_up ${ifn}
		ifconfig ${ifn}
	done
d45 1
a45 21
dhclient_prestop()
{
	if [ $dhclient_common_error -eq 1 ]; then
		return 1
	fi
	for ifn in ${_cooked_list}; do
		ipx_down ${ifn}
		ifalias_down ${ifn}
	done
	echo -n "Releasing DHCP leases:"
	for ifn in $_cooked_list ; do
		${command} -r $ifn
		if [ $? -eq 0 ]; then
			echo -n " $ifn"
		else
			_fail="$_fail $ifn"
		fi
	done
	echo '.'
	debug "The following leases failed to release: $_fail"
}
d47 1
a47 6
dhclient_poststop()
{
	for ifn in ${_cooked_list}; do
		ifscript_down ${ifn}
	done
}
d49 2
a50 3
if [ -n "$2" ]; then
	_cmdifn="$2"
	stop_cmd=":"
a52 8
load_rc_config $name
dhclient_common_error=0
dhclient_common || dhclient_common_error=1;
if [ -n "$_cooked_list" ]; then
	if [ -s $pidfile ]; then
		stop_cmd=":"
	fi
fi
@


1.17
log
@Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
@
text
@d8 1
a8 1
# REQUIRE: netif ipfw ipfilter mountcritlocal
@


1.16
log
@The err routine requires two arguments: an exit value and a string.
Additionaly, it will exit the script so an return statements after
calling it are superflous.
@
text
@d10 1
a10 1
# KEYWORD: FreeBSD nojail
@


1.16.2.1
log
@RCS file: /home/ncvs/src/etc/rc,v
----------------------------
revision 1.335
date: 2004/10/08 14:23:49;  author: mtm;  state: Exp;  lines: +0 -1
Remove an unused variable.

Submitted by: Pawel Worach <pawel.worach@@telia.com>
----------------------------
revision 1.334
date: 2004/10/07 13:55:25;  author: mtm;  state: Exp;  lines: +1 -1
Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
=============================================================================
RCS file: /home/ncvs/src/etc/rc.d/nsswitch,v
----------------------------
revision 1.4
date: 2004/09/16 17:03:12;  author: keramida;  state: Exp;  lines: +1 -1
Fix requirement of `network' to `NETWORK' because the former isn't
provided by any rc.d script.

Approved by:	mtm
=============================================================================
RCS file: /home/ncvs/src/etc/rc.d/pflog,v
----------------------------
revision 1.3
date: 2004/09/16 17:04:20;  author: keramida;  state: Exp;  lines: +1 -1
We don't have any providers of `beforenetlkm' in FreeBSD.  Remove the
dependency to it from our rc.d scripts.

Approved by:	mtm
=============================================================================

Approved by: re/scottl
@
text
@d10 1
a10 1
# KEYWORD: nojail
@


1.15
log
@Mark scripts as not usable inside a jail by adding keyword 'nojail'.

Some suggestions from:	rwatson, Ruben de Groot <mail25@@bzerk.org>
@
text
@d40 1
a40 2
			err "No such network interface: $_cmdifn"
			return 1
@


1.14
log
@Remove scripts we don't use from requirement lines. These were
hold-overs from the initial NetBSD import.
@
text
@d10 1
a10 1
# KEYWORD: FreeBSD
@


1.13
log
@Further shuffle runcom ordering so that netif does not start before
ipfw, but ipfw and ipfilter do start before dhclient.
@
text
@d8 1
a8 1
# REQUIRE: network netif ipfw ipfilter mountcritlocal
@


1.12
log
@Luke Mewburn has indicated that they (NetBSD) are not interested
in keeping the scripts under rc.d in sync with us. So, remove
NetBSD specific stuff (which made our scripts more complicated
than necessary).

The NetBSD ident string will be left intact, both for history and
also incase we wish to pull in future versions.
@
text
@d8 1
a8 1
# REQUIRE: network netif mountcritlocal
@


1.11
log
@Luke Mewburn has indicated that they (NetBSD) are not interested
in keeping the scripts under rc.d in sync with us. So, begin removal
of NetBSD specific stuff (which made our scripts more complicated
than necessary), starting with the NetBSD KEYWORD.
@
text
@d20 1
d22 4
a25 13
case "${OSTYPE}" in
FreeBSD)
	rcvar=
	start_precmd="dhclient_prestart"
	start_postcmd="dhclient_poststart"
	stop_precmd="dhclient_prestop"
	stop_postcmd="dhclient_poststop"
	;;
NetBSD)
	rcvar=$name
	command="/sbin/${name}"
	;;
esac
@


1.10
log
@Get rid of a nasty error message that tells us
dhclient couldn't get killed.

If we execute 'dhclient -r', dhclient gets already
killed, so there is no need to do it twice. Only do
this if we really have to release some leases.

Reviewed by:	silence on freebsd-rc@@yahoogroups.com
@
text
@d10 1
a10 1
# KEYWORD: FreeBSD NetBSD
@


1.9
log
@Always start dhclient in the background.

Reviewed by:	mtm
@
text
@d56 3
a58 2
	dhclient_common || return 1

d82 3
a84 2
	dhclient_common || return 1

d115 7
@


1.8
log
@Define the stop command to do nothing when only a specific
interface is to be stopped. In this case we don't want to go
beyond releasing the lease.
@
text
@d62 4
@


1.7
log
@When stopping a dhcp interface, don't just release the lease on
the address, also kill the dhclient process. Instead of doing the
release in the stop command, move it to the precmd stage and allow
rc.subr(8) to automatically kill the dhclient process by leaving the
stop command undefined.

Noticed by:	mbr
@
text
@d105 1
@


1.6
log
@Implement individual operations on static and dhcp interfaces. Previously
network interfaces could only be turned on and off as a group (all
static interfaces or all dhcp interfaces).

When used to start the interface a 'long form' ifconfig output is
used to show the status of the interface, but when stopping an interface
the script will simply output the name of the interface. This is simply my
personal preference. Hopefully as this functionality matures we can
stabilize on a prefered form of output for these scripts.

A stop command to the dhclient script now explicitly releases the dhcp lease.
Behaviour at system shutdown; however, is unchanged since dhclient is not,
by default, run at that time. The client will not release its lease
at shutdown.
@
text
@a25 1
	stop_cmd="dhclient_stop"
d75 1
a75 1
dhclient_stop()
d77 6
a93 10
}

dhclient_prestop()
{
	dhclient_common || return 1

	for ifn in ${_cooked_list}; do
		ipx_down ${ifn}
		ifalias_down ${ifn}
	done
@


1.5
log
@The dhcp_program and dhcp_flags variables have to be renamed to
take advantage of the rc.subr(8) glue. They are renamed dhclient_program
and dhclient_flags.
	o Rename them in rc.conf(5)
	o Rename them in /etc/defaults/rc.conf
	o Add the deprecated variables to /etc/rc.subr
	o Isolate the use  of the 'command' variable to the
	  NetBSD specific parts in /etc/rc.d/dhclient.
	o Now that dhcp_flags has also been renamed it will
	  be applied properly by rc.subr(8) glue code.

Reported by:	John Nielsen <john@@jnielsen.net>
@
text
@d26 3
d36 1
a36 1
dhclient_prestart()
d43 17
a59 1
	for ifn in ${dhcp_list}; do
d63 1
a63 1
	rc_flags="${rc_flags} ${dhcp_list}"
d69 1
a69 1
	for ifn in ${dhcp_list}; do
d75 36
@


1.4
log
@Run interface specific scripts for dhcp interfaces too.
This is how it has always been done (before and after rc.d) but
I somehow failed to include it when I broke up network1.

Submitted by:	bmah
Approved by:	markm (mentor)(implicit)
@
text
@a19 1
command="/sbin/${name}"
d29 1
d44 1
a44 1
	rc_flags="${rc_flags} ${dhcp_flags} ${dhcp_list}"
@


1.3
log
@Make use of the dhclient script. This will bring up/down dhcp
interfaces.

Approved by:	markm (mentor)
@
text
@d39 5
@


1.2
log
@Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next.

Submitted by:	Mike Makonnen <makonnen@@pacbell.net>
Reviewed by:	silence on -current and -hackers
Prodded by:	rwatson
@
text
@d8 1
a8 1
# REQUIRE: network mountcritlocal
d10 1
d17 1
a19 1
rcvar=$name
d22 29
@


1.1
log
@Initial revision
@
text
@d3 2
a4 1
# $NetBSD: dhclient,v 1.6 2000/07/26 00:11:49 lukem Exp $
d9 1
@


1.1.1.1
log
@Import the NetBSD 1.5 RC system.

Note that `rc' and `rc.shutdown' could not be imported because we already
have files with those names.
@
text
@@


1.1.1.2
log
@Sync with NetBSD's mainline.
@
text
@d3 1
a3 1
# $NetBSD: dhclient,v 1.7 2000/09/19 13:04:38 lukem Exp $
a7 1
# BEFORE:  NETWORKING
@

