head	1.41;
access;
symbols
	RELENG_8_4:1.41.0.2
	RELENG_9_1_0_RELEASE:1.39.2.1.4.2
	RELENG_9_1:1.39.2.1.0.4
	RELENG_9_1_BP:1.39.2.1
	RELENG_8_3_0_RELEASE:1.38.2.1.8.1
	RELENG_8_3:1.38.2.1.0.8
	RELENG_8_3_BP:1.38.2.1
	RELENG_9_0_0_RELEASE:1.39.2.1.2.1
	RELENG_9_0:1.39.2.1.0.2
	RELENG_9_0_BP:1.39.2.1
	RELENG_9:1.39.0.2
	RELENG_9_BP:1.39
	RELENG_7_4_0_RELEASE:1.37.2.1.8.1
	RELENG_8_2_0_RELEASE:1.38.2.1.6.1
	RELENG_7_4:1.37.2.1.0.8
	RELENG_7_4_BP:1.37.2.1
	RELENG_8_2:1.38.2.1.0.6
	RELENG_8_2_BP:1.38.2.1
	RELENG_8_1_0_RELEASE:1.38.2.1.4.1
	RELENG_8_1:1.38.2.1.0.4
	RELENG_8_1_BP:1.38.2.1
	RELENG_7_3_0_RELEASE:1.37.2.1.6.1
	RELENG_7_3:1.37.2.1.0.6
	RELENG_7_3_BP:1.37.2.1
	RELENG_8_0_0_RELEASE:1.38.2.1.2.1
	RELENG_8_0:1.38.2.1.0.2
	RELENG_8_0_BP:1.38.2.1
	RELENG_8:1.38.0.2
	RELENG_8_BP:1.38
	RELENG_7_2_0_RELEASE:1.37.2.1.4.1
	RELENG_7_2:1.37.2.1.0.4
	RELENG_7_2_BP:1.37.2.1
	RELENG_7_1_0_RELEASE:1.37.2.1.2.1
	RELENG_6_4_0_RELEASE:1.35.2.3.2.1
	RELENG_7_1:1.37.2.1.0.2
	RELENG_7_1_BP:1.37.2.1
	RELENG_6_4:1.35.2.3.0.2
	RELENG_6_4_BP:1.35.2.3
	RELENG_7_0_0_RELEASE:1.37.4.1
	RELENG_6_3_0_RELEASE:1.35.2.2
	RELENG_7_0:1.37.0.4
	RELENG_7_0_BP:1.37
	RELENG_6_3:1.35.2.2.0.2
	RELENG_6_3_BP:1.35.2.2
	RELENG_7:1.37.0.2
	RELENG_7_BP:1.37
	RELENG_6_2_0_RELEASE:1.35.2.1
	RELENG_6_2:1.35.2.1.0.4
	RELENG_6_2_BP:1.35.2.1
	RELENG_5_5_0_RELEASE:1.33.2.1
	RELENG_5_5:1.33.2.1.0.6
	RELENG_5_5_BP:1.33.2.1
	RELENG_6_1_0_RELEASE:1.35.2.1
	RELENG_6_1:1.35.2.1.0.2
	RELENG_6_1_BP:1.35.2.1
	RELENG_6_0_0_RELEASE:1.35
	RELENG_6_0:1.35.0.4
	RELENG_6_0_BP:1.35
	RELENG_6:1.35.0.2
	RELENG_6_BP:1.35
	RELENG_5_4_0_RELEASE:1.33.2.1
	RELENG_5_4:1.33.2.1.0.4
	RELENG_5_4_BP:1.33.2.1
	RELENG_5_3_0_RELEASE:1.33.2.1
	RELENG_5_3:1.33.2.1.0.2
	RELENG_5_3_BP:1.33.2.1
	RELENG_5:1.33.0.2
	RELENG_5_BP:1.33
	old_RELENG_5_2_1_RELEASE:1.29
	old_RELENG_5_2_0_RELEASE:1.29
	old_RELENG_5_2:1.29.0.2
	old_RELENG_5_2_BP:1.29
	old_RELENG_5_1_0_RELEASE:1.25
	old_RELENG_5_1:1.25.0.2
	old_RELENG_5_1_BP:1.25
	old_RELENG_5_0_0_RELEASE:1.23
	old_RELENG_5_0:1.23.0.2
	old_RELENG_5_0_BP:1.23
	old_old_RELENG_4_6_1_RELEASE:1.5.2.12
	old_old_RELENG_4_6_0_RELEASE:1.5.2.12
	old_old_RELENG_4_6:1.5.2.12.0.2
	old_old_RELENG_4_6_BP:1.5.2.12
	old_old_RELENG_4_5_0_RELEASE:1.5.2.9
	old_old_RELENG_4_5:1.5.2.9.0.2
	old_old_RELENG_4_5_BP:1.5.2.9
	old_old_RELENG_4_4_0_RELEASE:1.5.2.8
	old_old_RELENG_4_4:1.5.2.8.0.2
	old_old_RELENG_4_4_BP:1.5.2.8
	old_old_RELENG_4_3_0_RELEASE:1.5.2.5
	old_old_RELENG_4_3:1.5.2.5.0.2
	old_old_RELENG_4_3_BP:1.5.2.5
	old_old_RELENG_4_2_0_RELEASE:1.5.2.2
	old_old_RELENG_4_1_1_RELEASE:1.5.2.1
	old_old_PRE_SMPNG:1.6
	old_old_RELENG_4_1_0_RELEASE:1.5.2.1
	old_old_RELENG_3_5_0_RELEASE:1.2.2.1
	old_old_RELENG_4_0_0_RELEASE:1.5
	old_old_RELENG_4:1.5.0.2
	old_old_RELENG_4_BP:1.5
	old_old_RELENG_3_4_0_RELEASE:1.2.2.1
	old_old_RELENG_3_3_0_RELEASE:1.2.2.1
	old_old_RELENG_3_2_PAO:1.2.2.1.0.2
	old_old_RELENG_3_2_PAO_BP:1.2.2.1
	old_old_RELENG_3_2_0_RELEASE:1.2.2.1
	old_old_RELENG_3:1.2.0.2;
locks; strict;
comment	@# @;


1.41
date	2012.11.17.01.49.05;	author svnexp;	state Exp;
branches
	1.41.2.1;
next	1.40;

1.40
date	2012.09.11.05.04.59;	author obrien;	state Exp;
branches;
next	1.39;

1.39
date	2011.09.19.15.56.50;	author hrs;	state Exp;
branches
	1.39.2.1;
next	1.38;

1.38
date	2007.12.08.23.00.28;	author dougb;	state Exp;
branches
	1.38.2.1;
next	1.37;

1.37
date	2007.06.02.05.24.39;	author dougb;	state Exp;
branches
	1.37.2.1
	1.37.4.1;
next	1.36;

1.36
date	2005.12.10.20.21.45;	author dougb;	state Exp;
branches;
next	1.35;

1.35
date	2005.03.02.19.03.08;	author brooks;	state Exp;
branches
	1.35.2.1;
next	1.34;

1.34
date	2004.10.07.13.55.26;	author mtm;	state Exp;
branches;
next	1.33;

1.33
date	2004.04.28.09.09.27;	author ru;	state Exp;
branches
	1.33.2.1;
next	1.32;

1.32
date	2004.03.23.23.22.34;	author brooks;	state Exp;
branches;
next	1.31;

1.31
date	2004.03.08.12.25.05;	author pjd;	state Exp;
branches;
next	1.30;

1.30
date	2004.01.05.19.14.47;	author brooks;	state Exp;
branches;
next	1.29;

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

1.28
date	2003.10.03.19.57.58;	author phk;	state Exp;
branches;
next	1.27;

1.27
date	2003.10.03.19.07.31;	author phk;	state Exp;
branches;
next	1.26;

1.26
date	2003.10.03.18.26.33;	author phk;	state Exp;
branches;
next	1.25;

1.25
date	2003.02.15.16.34.14;	author jhay;	state Exp;
branches;
next	1.24;

1.24
date	2002.12.22.22.18.41;	author dillon;	state Exp;
branches;
next	1.23;

1.23
date	2002.10.12.10.31.31;	author schweikh;	state Exp;
branches;
next	1.22;

1.22
date	2002.10.01.13.29.44;	author ru;	state Exp;
branches;
next	1.21;

1.21
date	2002.09.22.09.48.02;	author phk;	state Exp;
branches;
next	1.20;

1.20
date	2002.06.25.01.52.33;	author bsd;	state Exp;
branches;
next	1.19;

1.19
date	2002.06.13.22.14.36;	author gordon;	state Exp;
branches;
next	1.18;

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

1.17
date	2002.02.23.01.49.20;	author obrien;	state Exp;
branches;
next	1.16;

1.16
date	2002.02.22.19.05.22;	author obrien;	state Exp;
branches;
next	1.15;

1.15
date	2001.12.26.17.18.39;	author rwatson;	state Exp;
branches;
next	1.14;

1.14
date	2001.11.27.22.12.27;	author rwatson;	state Exp;
branches;
next	1.13;

1.13
date	2001.10.17.14.30.19;	author bsd;	state Exp;
branches;
next	1.12;

1.12
date	2001.06.01.10.07.15;	author ru;	state Exp;
branches;
next	1.11;

1.11
date	2001.05.09.15.13.51;	author bsd;	state Exp;
branches;
next	1.10;

1.10
date	2001.05.01.20.13.59;	author phk;	state Exp;
branches;
next	1.9;

1.9
date	2001.04.25.05.46.40;	author imp;	state Exp;
branches;
next	1.8;

1.8
date	2001.04.24.07.02.01;	author imp;	state Exp;
branches;
next	1.7;

1.7
date	2000.10.08.19.18.24;	author obrien;	state Exp;
branches;
next	1.6;

1.6
date	2000.04.27.08.43.48;	author sheldonh;	state Exp;
branches;
next	1.5;

1.5
date	2000.01.06.18.17.38;	author luigi;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	99.09.13.17.09.07;	author peter;	state Exp;
branches;
next	1.3;

1.3
date	99.09.13.15.44.18;	author sheldonh;	state Exp;
branches;
next	1.2;

1.2
date	99.02.10.18.08.16;	author jkh;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	99.02.09.17.17.18;	author dillon;	state Exp;
branches;
next	;

1.41.2.1
date	2012.11.17.01.49.05;	author svnexp;	state dead;
branches;
next	1.41.2.2;

1.41.2.2
date	2013.03.28.13.02.44;	author svnexp;	state Exp;
branches;
next	;

1.39.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.39.2.1.2.1
	1.39.2.1.4.1;
next	1.39.2.2;

1.39.2.2
date	2012.10.26.18.06.49;	author obrien;	state Exp;
branches;
next	1.39.2.3;

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

1.39.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.39.2.1.2.2;

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

1.39.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.39.2.1.4.2;

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

1.38.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.38.2.1.2.1
	1.38.2.1.4.1
	1.38.2.1.6.1
	1.38.2.1.8.1;
next	1.38.2.2;

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

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

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

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

1.38.2.1.8.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.38.2.1.8.2;

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

1.37.2.1
date	2008.01.29.00.18.08;	author dougb;	state Exp;
branches
	1.37.2.1.2.1
	1.37.2.1.4.1
	1.37.2.1.6.1
	1.37.2.1.8.1;
next	1.37.2.2;

1.37.2.2
date	2012.11.17.08.01.22;	author svnexp;	state Exp;
branches;
next	;

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

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

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

1.37.2.1.8.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.37.2.1.8.2;

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

1.37.4.1
date	2008.01.29.00.22.33;	author dougb;	state Exp;
branches;
next	;

1.35.2.1
date	2005.12.21.07.11.34;	author dougb;	state Exp;
branches;
next	1.35.2.2;

1.35.2.2
date	2007.10.24.21.36.09;	author dougb;	state Exp;
branches;
next	1.35.2.3;

1.35.2.3
date	2008.01.29.00.33.16;	author dougb;	state Exp;
branches
	1.35.2.3.2.1;
next	1.35.2.4;

1.35.2.4
date	2012.11.17.07.39.09;	author svnexp;	state Exp;
branches;
next	;

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

1.33.2.1
date	2004.10.10.09.50.54;	author mtm;	state Exp;
branches;
next	;

1.5.2.1
date	2000.05.28.19.17.15;	author asmodai;	state Exp;
branches;
next	1.5.2.2;

1.5.2.2
date	2000.10.30.10.40.11;	author obrien;	state Exp;
branches;
next	1.5.2.3;

1.5.2.3
date	2001.03.06.01.58.45;	author obrien;	state Exp;
branches;
next	1.5.2.4;

1.5.2.4
date	2001.03.06.02.15.04;	author obrien;	state Exp;
branches;
next	1.5.2.5;

1.5.2.5
date	2001.04.17.15.52.28;	author luigi;	state Exp;
branches;
next	1.5.2.6;

1.5.2.6
date	2001.04.22.23.14.46;	author bsd;	state Exp;
branches;
next	1.5.2.7;

1.5.2.7
date	2001.05.11.17.46.57;	author bsd;	state Exp;
branches;
next	1.5.2.8;

1.5.2.8
date	2001.07.24.09.49.37;	author dd;	state Exp;
branches;
next	1.5.2.9;

1.5.2.9
date	2001.11.02.23.20.43;	author bsd;	state Exp;
branches;
next	1.5.2.10;

1.5.2.10
date	2002.02.12.17.25.11;	author luigi;	state Exp;
branches;
next	1.5.2.11;

1.5.2.11
date	2002.02.12.18.36.23;	author luigi;	state Exp;
branches;
next	1.5.2.12;

1.5.2.12
date	2002.03.15.08.00.37;	author luigi;	state Exp;
branches;
next	1.5.2.13;

1.5.2.13
date	2002.07.04.13.22.35;	author bsd;	state Exp;
branches;
next	;

1.2.2.1
date	99.03.09.17.04.40;	author luigi;	state Exp;
branches;
next	;


desc
@@


1.41
log
@Switching exporter and resync
@
text
@#!/bin/sh
#
# Copyright (c) 1999  Matt Dillon
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: head/etc/rc.d/resolv 240336 2012-09-11 05:04:59Z obrien $
#

# PROVIDE: resolv
# REQUIRE: netif FILESYSTEMS
# KEYWORD: nojail

. /etc/rc.subr

name="resolv"
stop_cmd=':'

load_rc_config $name

# if the info is available via dhcp/kenv
# build the resolv.conf
#
if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then
	interface="`/bin/kenv boot.netif.name`"
	(
	if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then
		echo domain `/bin/kenv dhcp.domain-name`
	fi

	set -- `/bin/kenv dhcp.domain-name-servers`
	for ns in `IFS=','; echo $*`; do
		echo nameserver $ns
	done
	) | /sbin/resolvconf -a ${interface}:dhcp4
fi

@


1.41.2.1
log
@file resolv was added on branch RELENG_8_4 on 2013-03-28 13:02:44 +0000
@
text
@d1 57
@


1.41.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 57
#!/bin/sh
#
# Copyright (c) 1999  Matt Dillon
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: releng/8.4/etc/rc.d/resolv 180563 2008-07-16 19:22:48Z dougb $
#

# PROVIDE: resolv
# REQUIRE: netif
# KEYWORD: nojail

. /etc/rc.subr

name="resolv"
stop_cmd=':'

load_rc_config $name

# if the info is available via dhcp/kenv
# build the resolv.conf
#
if [ ! -e /etc/resolv.conf -a \
    -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then
	> /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
fi

@


1.40
log
@SVN rev 240336 on 2012-09-11 05:04:59Z by obrien

Simply things so that "#REQUIRE: FILESYSTEMS" means the file
systems are fully "ready to go".

'FILESYSTEMS' states: "This is a dummy dependency, for services which
require file systems to be mounted before starting."  However, we have
'var' which is was run after 'FILESYSTEMS' and can mount /var if it
already isn't mounted.  Furthermore, several scripts cannot use /var
until 'cleanvar' has done its thing.  Thus "FILESYSTEMS" hasn't really
meant all critical file systems are fully usable.
@
text
@d27 1
a27 1
# $FreeBSD$
@


1.39
log
@SVN rev 225670 on 2011-09-19 15:56:50Z by hrs

Use resolvconf(8) to create /etc/resolv.conf, not directly overwrite it.

Approved by:	re (kib)
@
text
@d31 1
a31 1
# REQUIRE: netif var
@


1.39.2.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.39.2.2
log
@SVN rev 242153 on 2012-10-26 18:06:49Z by obrien

MFC: r240336:
  Simply things so that "#REQUIRE: FILESYSTEMS" means the file
  systems are fully "ready to go".

  'FILESYSTEMS' states: "This is a dummy dependency, for services which
  require file systems to be mounted before starting."  However, we have
  'var' which is was run after 'FILESYSTEMS' and can mount /var if it
  already isn't mounted.  Furthermore, several scripts cannot use /var
  until 'cleanvar' has done its thing.  Thus "FILESYSTEMS" hasn't really
  meant all critical file systems are fully usable.
@
text
@d31 1
a31 1
# REQUIRE: netif FILESYSTEMS
@


1.39.2.3
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
@d27 1
a27 1
# $FreeBSD: stable/9/etc/rc.d/resolv 242153 2012-10-26 18:06:49Z obrien $
@


1.39.2.1.4.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.39.2.1.4.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/9.1/etc/rc.d/resolv 225670 2011-09-19 15:56:50Z hrs $
@


1.39.2.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.39.2.1.2.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/9.0/etc/rc.d/resolv 225670 2011-09-19 15:56:50Z hrs $
@


1.38
log
@Add an empty stop_cmd to the remaining scripts that don't start
daemons and don't already have one.
@
text
@d31 1
a31 1
# REQUIRE: netif
d44 3
a46 4
if [ ! -e /etc/resolv.conf -a \
    -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then
	> /etc/resolv.conf

d48 1
a48 1
		echo domain `/bin/kenv dhcp.domain-name` > /etc/resolv.conf
d53 1
a53 1
		echo nameserver $ns >> /etc/resolv.conf;
d55 1
@


1.38.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.38.2.2
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
@d27 1
a27 1
# $FreeBSD: stable/8/etc/rc.d/resolv 180563 2008-07-16 19:22:48Z dougb $
@


1.38.2.1.8.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.38.2.1.8.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/8.3/etc/rc.d/resolv 180563 2008-07-16 19:22:48Z dougb $
@


1.38.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.38.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.38.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.37
log
@Add REQUIRE netif to make ordering more deterministic, and to make sure
we have a fighting chance of having useful stuff from DHCP.

Tighten up the code a little, and fix whitespace issues.
@
text
@d37 1
@


1.37.4.1
log
@MFC functional changes to etc:
1. yar's "dry run" patch to Makefile
2. Add zfs to the list of filesystems to check in
periodic/security/100.chksetuid
3. GC the nfslocking script, which has been superseded by lockd and statd
4. Add security warning to rc.d/jail
5. Add stop_cmd=':' to those rc.d scripts that do not start services,
but did not already have a stop_cmd.

And update comments in rc.firewall* and defaults/rc.conf.

Approved by:	re (kensmith)
@
text
@a36 1
stop_cmd=':'
@


1.37.2.1
log
@MFC functional changes to etc:
1. yar's "dry run" patch to Makefile
2. Add zfs to the list of filesystems to check in
periodic/security/100.chksetuid
3. GC the nfslocking script, which has been superseded by lockd and statd
4. Add security warning to rc.d/jail
5. Add stop_cmd=':' to those rc.d scripts that do not start services,
but did not already have a stop_cmd.
@
text
@a36 1
stop_cmd=':'
@


1.37.2.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: stable/7/etc/rc.d/resolv 220110 2011-03-28 19:29:30Z dougb $
@


1.37.2.1.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.37.2.1.8.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/7.4/etc/rc.d/resolv 175781 2008-01-29 00:18:08Z dougb $
@


1.37.2.1.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.37.2.1.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.37.2.1.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.36
log
@Remove rcconf.sh from /etc/rc.d, and instead load the configuration
as part of rc. Doing this, and the sourcing of rc.subr after we have
determined if we are booting diskless (and correspondingly run
rc.initdiskless if necessary) are safe, and actually allow fewer files
to be needed on the diskless box. This also allows variables from
the configuration to be available to rc itself, such as ...

Add a variable to rc.conf, early_late_divider, which designates the
script which separates the early and late stages of the boot process.
Default this to mountcritlocal, and add text to etc/defaults/rc.conf,
rc.conf(5) and diskless(8) which describes how and why one might want
to change this.

Reviewed by:	brooks
@
text
@d31 1
d45 1
a45 1
	/bin/cat /dev/null > /etc/resolv.conf
d51 4
a54 4
        set -- `/bin/kenv dhcp.domain-name-servers`
        for ns in `IFS=','; echo $*`; do
                echo nameserver $ns >> /etc/resolv.conf;
        done
@


1.35
log
@It is sufficent to require rcconf rather than initdiskless.
@
text
@a30 1
# REQUIRE: rcconf
@


1.35.2.1
log
@MFC the inclusion of scripts from the local_startup directories
into the base rcorder, and related changes.
@
text
@d31 1
@


1.35.2.2
log
@MFC revisions 1.13 of NETWORKING and 1.37 of resolv:
1. Make resolv order deterministic by REQUIRE'ing it in NETWORKING,
and having resolv REQUIRE netif.
2. Tighten up the code and fix whitespace in resolv
@
text
@a30 1
# REQUIRE: netif
d44 1
a44 1
	> /etc/resolv.conf
d50 4
a53 4
	set -- `/bin/kenv dhcp.domain-name-servers`
	for ns in `IFS=','; echo $*`; do
		echo nameserver $ns >> /etc/resolv.conf;
	done
@


1.35.2.3
log
@MFC a more limited set of changes that make sense for this branch:

1. GC the nfslocking script, which has been superseded by lockd and statd
2. Add security warning to rc.d/jail
3. Add stop_cmd=':' to those rc.d scripts that do not start services,
but did not already have a stop_cmd.
@
text
@a36 1
stop_cmd=':'
@


1.35.2.4
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: stable/6/etc/rc.d/resolv 175784 2008-01-29 00:33:16Z dougb $
@


1.35.2.3.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.34
log
@Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
@
text
@d31 1
a31 1
# REQUIRE: initdiskless rcconf
@


1.33
log
@Replace shell's positional parameters safely.
@
text
@d32 1
a32 1
# KEYWORD: FreeBSD nojail
@


1.33.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
@d32 1
a32 1
# KEYWORD: nojail
@


1.32
log
@Overhaul the /etc/rc.d/diskless script by splitting it out into
hostname, resolve, tmp, and var scripts.  The latter three are new and
were repo copied.  These scripts no longer depend on being booted with
and NFS root instead attempt to automaticly create mfs /tmp and /var
volumes if the they are not writable.  This behavior can be overridden
in /etc/rc.conf.

Reviewed by:    luigi, pjd
@
text
@d51 1
a51 1
        set `/bin/kenv dhcp.domain-name-servers`
@


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

Some suggestions from:	rwatson, Ruben de Groot <mail25@@bzerk.org>
@
text
@d30 2
a31 3
# PROVIDE: diskless
# REQUIRE: initdiskless rcconf mountcritlocal
# BEFORE: addswap random
d34 1
a34 2
dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
[ ${dlv:=0} -eq 0 ] && exit 0
d36 1
a36 1
name="diskless2"
d38 1
a38 120
# Provide a function for normalizing the mounting of memory
# filesystems.  This should allow the rest of the code here to remain
# as close as possible between 5-current and 4-stable.
#   $1 = size
#   $2 = mount point
#   $3 = (optional) bytes-per-inode
mount_md() {
	if [ -n "$3" ]; then
		bpi="-i $3"
	fi
	/sbin/mdmfs $bpi -s $1 -M md $2
}

# If there is a global system configuration file, suck it in.
#
if [ -r /etc/rc.subr ]; then
	. /etc/rc.subr
	load_rc_config $name
elif [ -r /etc/defaults/rc.conf ]; then
	. /etc/defaults/rc.conf
	source_rc_confs
elif [ -r /etc/rc.conf ]; then
	. /etc/rc.conf
fi

# If we do not have a writable /var, create a memory
# filesystem for /var.  We don't have /usr yet so
# use mkdir instead of touch to test.  We want mount
# to record its mounts so we have to make sure /var/db
# exists before doing the mount -a.
#
if (/bin/mkdir /var/.diskless 2> /dev/null); then
        rmdir /var/.diskless
else
	echo "+++ mount_md of /var"
	mount_md ${varsize:=32m} /var
fi

if [ ! -d /var/db ]; then
	mkdir /var/db
fi

# Now we need the rest of our mounts, particularly /usr
#
mount -a       # chown and chgrp are in /usr

# Populate /var
#
echo "+++ populate /var using /etc/mtree/BSD.var.dist"
/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var > /dev/null
case ${sendmail_enable} in
[Nn][Oo][Nn][Ee])
	;;
*)
	/usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p / > /dev/null
	;;
esac

echo "+++ create log files based on the contents of /etc/newsyslog.conf"
LOGFILES=`/usr/bin/awk '$1 != "#" { printf "%s ", $1 } ' /etc/newsyslog.conf`
if [ -n "$LOGFILES" ]; then
	/usr/bin/touch $LOGFILES
fi

echo "+++ create lastlog"
/usr/bin/touch /var/log/lastlog

# Make sure our aliases database is uptodate, the aliases may have
# been overriden in /conf.
#
case ${sendmail_enable} in
[Nn][Oo][Nn][Ee])
	;;
*)
	/usr/bin/newaliases
	;;
esac

# XXX make sure to create one dir for each printer as requested by lpd
#
# If we do not have a writable /tmp, create a memory
# filesystem for /tmp.  If /tmp is a symlink (e.g. to /var/tmp,
# then it should already be writable).
#
if (/bin/mkdir /tmp/.diskless 2> /dev/null); then
	rmdir /tmp/.diskless
else
	if [ -h /tmp ]; then
		echo "*** /tmp is a symlink to a non-writable area!"
		echo "dropping into shell, ^D to continue anyway."
		/bin/sh
	else
		mount_md ${tmpsize:=20480} /tmp
		chmod 01777 /tmp
	fi
fi

if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
	# we have DEVFS, no worries...
	true
elif (/bin/mkdir /dev/.diskless 2> /dev/null); then
	# if /dev is writable assume it has already been populated
	# via /etc/rc.d/initdiskless
	#
	rmdir /dev/.diskless
else
	(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
	mount_md 4096 /dev 512
	(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
	rm -f /tmp/dev.tmp
fi

# generate our hostname
#
if [ -z "`hostname -s`" -a \
    "x`/bin/kenv dhcp.host-name`" != "x" ]; then
        hostname=`/bin/kenv dhcp.host-name`
        hostname $hostname
	echo "Hostname is $hostname"
fi
d44 6
a49 2
    "x`/bin/kenv dhcp.domain-name-servers`" != "x" ]; then
        echo domain `/bin/kenv dhcp.domain-name` > /etc/resolv.conf
@


1.30
log
@Don't run newaliases if sendmail_enable=NONE.

Submitted by:	Matt Peterson <matt at peterson dot org>
Approved by:	silence on freebsd-rc
@
text
@d33 1
a33 1
# KEYWORD: FreeBSD
@


1.29
log
@Update references to rc.diskless[12]
@
text
@d110 7
a116 1
/usr/bin/newaliases
@


1.28
log
@Fix typo.

Spotted by:	"Bjoern A. Zeeb" <bzeeb@@zabbadoz.net>
@
text
@d136 1
a136 1
	# via rc.diskless1
@


1.27
log
@More checking if kenv actually know something.

Guard against test(1)-unfriendly outputs from kenv.
@
text
@d149 1
a149 1
    "x`/bin/kenv dhdp.host-name`" != "x" ]; then
@


1.26
log
@In case we have no /etc/resolv.conf, don't try to make it out of
thin blue air if the kenv doesn't have any info.

This improves the truth value of the comment above significantly and
reduces the bogous output on the console considerably.
@
text
@d148 2
a149 1
if [ -z "`hostname -s`" ]; then
d158 2
a159 1
if [ ! -e /etc/resolv.conf -a `/bin/kenv dhcp.domain-name-servers` != "" ]; then
@


1.25
log
@kenv moved from /usr/bin/ to /bin/.
@
text
@d157 1
a157 1
if [ ! -e /etc/resolv.conf ]; then
@


1.24
log
@Do not unconditionally load the configuration files for the RCNG case.
Instead, load them as part of the rc.d system.  This allows us to prioritize
the initidiskless script so it runs before the configuration files are loaded
and allows us to get rid of the exit 2 hack in /etc/rc.  The exit 2 never
worked anyway since it did not unset the prior configuration, causing the
diskless code to not operate properly.

Do a major cleanup and revamping of the diskless code for RCNG.  This will
be backported to the non-RCNG scripts as well as -stable.

With suggestions from: Mike Makonnen <mtm@@identd.net>
MFC after:	7 days
@
text
@d149 1
a149 1
        hostname=`/usr/bin/kenv dhcp.host-name`
d158 1
a158 1
        echo domain `/usr/bin/kenv dhcp.domain-name` > /etc/resolv.conf
d160 1
a160 1
        set `/usr/bin/kenv dhcp.domain-name-servers`
@


1.23
log
@Fix style bugs:
* Space -> tabs conversion.
* Removed blanks before semicolon in "if ... ; then".
* Proper indentation of misindented lines.
* Put a full stop after some comments.
* Removed whitespace at end of line.

Approved by:	silence from gordon
@
text
@d31 1
a31 1
# REQUIRE: initdiskless mountcritlocal
d45 4
a48 6
#   $3 = md unit number (ignored in pre 5.0 systems)
#   $4 = (optional) bytes-per-inode
mount_md()
{
	if [ -n "$4" ]; then
		bpi="-i $4"
d50 1
a50 1
	/sbin/mdmfs $bpi -s $1 -M md$3 $2
d65 12
a76 2
echo "+++ mount_md of /var"
mount_md ${varsize:=32m} /var 1
d78 10
d89 1
a89 1
/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
d94 1
a94 1
	/usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p /
d107 4
a110 6
mount -a       # chown and chgrp are in /usr

# Since we are starting with a very fresh /etc on an MFS:
if [ -d /conf/default/etc ]; then
	newaliases
fi
a111 1
#
d114 3
a116 3

# If /tmp is a symlink, assume it points to somewhere writable, like
# /var/tmp, otherwise, use a small memory filesystem for /tmp.
d118 11
a128 6
# XXX: mtree runs too early to create any directories needed in /tmp,
# so if /var/tmp == /tmp, then you don't get a vi.recover.
#
if [ ! -L /tmp ]; then
	mount_md ${tmpsize:=64m} /tmp 2
	chmod 01777 /tmp
d131 1
a131 1
if sysctl vfs.devfs.generation > /dev/null 2>&1; then
d134 5
a139 1
	# extract a list of device entries, then copy them to a writable fs
d141 1
a141 1
	mount_md 4096 /dev 3 512
d143 1
d145 21
@


1.22
log
@test -h is deprecated; use -L instead.

PR:             bin/40846
@
text
@d58 2
a59 2
        . /etc/rc.subr
        load_rc_config $name
d111 1
a111 1
if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
@


1.21
log
@Use mdmfs(8) rather than rolling our own RAM-disks.

Sponsored by:	DARPA & NAI Labs.
@
text
@d106 1
a106 1
if [ ! -h /tmp ]; then
@


1.20
log
@Apply same fix as Rev 1.19 of /etc/rc.diskless2: create sendmail
required directories if sendmail_enable is not set to "none".

Suggested by:   gordon
@
text
@d52 1
a52 4
	/sbin/mdconfig -a -t malloc -s $1 -u $3
	/sbin/disklabel -r -w md$3 auto
	/sbin/newfs $bpi /dev/md$3c
	/sbin/mount /dev/md$3c $2
@


1.19
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
@d76 7
@


1.18
log
@fix backwards spelling
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.17 2002/02/23 01:49:20 obrien Exp $
d63 7
@


1.17
log
@The usage of 'newaliases' needs to be after we know for sure that /usr
is mounted.

Submitted by:	rizzo
@
text
@d25 1
a25 1
# $FreeBSD$
d78 1
a78 1
if
@


1.16
log
@The existing bazaar and site-specific policy in rc.diskless1 is Just Wrong;
and looks like no other Unix diskless configuration I've ever seen.
Thus allow a more traditional /etc.

Note, the use of an MFS /var should also be settable.
Otherwise installing ports(packages) is just a total PITA.
@
text
@d75 5
@


1.15
log
@o Add a comment indicating that if /tmp==/var/tmp in rc.diskless2, the
  md device and file system creation occurs *after* mtree is run, and
  as such an /var/tmp/* or /tmp/* entries will be under the mountpoint
  (or fail) rather than appearing in the md filesystems.  This prevents
  the creation of vi.recover, and might affect other localizations that
  rely on the mtree calls affecting these directories.
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.14 2001/11/27 22:12:27 rwatson Exp $
d59 1
a59 1
mount_md ${varsize:=65536} /var 1
d86 1
a86 1
	mount_md ${tmpsize:=20480} /tmp 2
@


1.14
log
@Remeber to set the permissions on an md-backed /tmp to 01777, rather than
using the default of 0755.
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.13 2001/10/17 14:30:19 bsd Exp $
d81 4
@


1.13
log
@Ensure that /var/log/lastlog exists so that login doesn't complain.

Submitted by:	Harti Brandt <brandt@@fokus.gmd.de>
MFC after:	2 weeks
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.12 2001/06/01 10:07:15 ru Exp $
d83 1
@


1.12
log
@Remove vestiges of MFS.
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.11 2001/05/09 15:13:51 bsd Exp $
d69 3
@


1.11
log
@  * Simplify the population of the /etc memory filesystem.  To avoid
    the null mount, we currently create a temporary mfs on /tmp, copy
    /etc to /tmp, then mount /etc as mfs and copy everything back from
    /tmp, then delete the /tmp mfs.

    The patch eliminates the temporary /tmp mfs and the subsequent
    copying and simply populates the /etc mfs by copying from
    /conf/default/etc.  This requires that /conf/default/etc contain a
    complete copy of all the /etc stuff instead of just overrides.  I
    don't think that is too much of an extra step in setting up a
    diskless environment.

  * Provide the ability to make /tmp a memory filesystem independent
    of /var.  This removes the requirement that /tmp be a symlink to
    /var/tmp and this makes the diskless code work with the default
    filesystem layout.  If a seperate /tmp memory filesystem is
    created, the 'tmpsize' environment variable is used to determine
    its size (default to 10 Meg).

  * Reduce diffs between the -current and -stable versions of these
    files to a bare minimum.  Only the definition of the shell
    function 'mount_md' is different.

Not Objected to by: -arch@@, -small@@

MFC after: 2 days
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.10 2001/05/01 20:13:59 phk Exp $
d58 1
a58 1
echo "+++ mfs_mount of /var"
@


1.10
log
@Don't mount a md(4) over /dev on DEVFS enabled diskless systems.
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.9 2001/04/25 05:46:40 imp Exp $
d32 7
d40 3
d45 1
a45 1
	/sbin/newfs /dev/md$3c
d59 1
a59 1
mount_md ${varsize:=65536} /var 2
d76 5
a80 5
# We assume that /tmp is symlinked to /var/tmp on the shared root
# partition. mount_null seems to have problems.
#if [ ! -h /tmp -a ! -h /var/tmp ]; then
#	mount_null /var/tmp /tmp
#fi
d88 1
a88 1
	mount_mfs -s 4096 -i 512 -T qp120at dummy /dev
@


1.9
log
@Move to using md.
o create a simple wrapper function mount_md that makes it easy to
  move from mount_mfs.

# NOTE: you will need to MAKEDEV md[0123] in order for this to work.

Reviewed by: bsd, keichii
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.8 2001/04/24 07:02:01 imp Exp $
d72 9
a80 5
# extract a list of device entries, then copy them to a writable partition
(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
echo "+++ mount_mfs of /dev"
mount_md 4096 /dev 3
(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
@


1.8
log
@MFS: the MFS still applies to -current until such time as someone fixes
rc.diskless2 to use mdconfig rather than mount_mfs.  These changes are
still relevant to -current.
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.7 2000/10/08 19:18:24 obrien Exp $
d32 7
d49 1
a49 1
mount_mfs -s ${varsize:=65536} -T qp120at dummy /var
d75 1
a75 1
mount_mfs -s 4096 -i 512 -T qp120at dummy /dev
@


1.7
log
@Add copyright notices.  Other systems have been barrowing our /etc files
w/o giving any credit.
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.6 2000/04/27 08:43:48 sheldonh Exp $
d41 1
d43 12
a54 12
var_dirs="run dev db msgs tmp spool spool/mqueue spool/lpd spool/output \
	spool/output/lpd"
for i in ${var_dirs}
do
    mkdir /var/${i}
done
chmod 755 /var/run
chmod 755 /var/db
chmod 755 /var/spool
chmod 1777 /var/tmp
chown -R root.daemon /var/spool/output
chgrp daemon /var/spool/lpd
d59 5
a63 3
if [ ! -h /tmp -a ! -h /var/tmp ]; then
	mount_null /var/tmp /tmp
fi
d67 1
@


1.6
log
@Add to defaults/rc.conf a new function source_rc_confs which rc
scripts may use to source safely overrides in ${rc_conf_files}
files.

This protects users who insist on the bad practice of copying
/etc/defaults/rc.conf to /etc/rc.conf from a recursive loop
that exhausts available file descriptors.

Several people have expressed interest in breaking this function
out into its own shell script.  Anyone who wants to embark on
such an undertaking would do well to study the attributed PR.

PR:		17595
Reported by:	adrian
Submitted by:	Doug Barton <Doug@@gorean.org>
@
text
@d1 27
a27 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5 2000/01/06 18:17:38 luigi Exp $
@


1.5
log
@Cleanup diskless support in current, mostly aligning it to the one
in the 3.x branch. Also remove the dependency on /usr to find the
boot address/interface.
Mostly-submitted-abd-tested-by: MIHIRA Sanpei Yoshiro <sanpei@@sanpei.org>
@
text
@d1 1
a1 1
# $FreeBSD: src/etc/rc.diskless2,v 1.4 1999/09/13 17:09:07 peter Exp $
d10 1
@


1.5.2.1
log
@MFC:	- add source_rc_confs

Reminded of, while working on the readline MFC, by:
	Mike Harding <mvh@@ix.netcom.com>
@
text
@d1 1
a1 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5 2000/01/06 18:17:38 luigi Exp $
a9 1
	source_rc_confs
@


1.5.2.2
log
@MFC: Add copyright.
@
text
@d1 1
a1 27
# Copyright (c) 1999  Matt Dillon
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD$
#

@


1.5.2.3
log
@MFC: add copyright notices
@
text
@d25 1
a25 27
# Copyright (c) 1999  Matt Dillon
#

# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.2 2000/10/30 10:40:11 obrien Exp $
@


1.5.2.4
log
@Grrr. patch really did a number on me with these.
@
text
@d25 27
a51 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.3 2001/03/06 01:58:45 obrien Exp $
@


1.5.2.5
log
@Fixes for diskless support.
in /etc/rc, let rc.diskless2 do the necessary mounts instead of
running mount -a -t nonfs

in /etc/rc.diskless2, do the various mounts in the right order

Approved-by: jkh
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.4 2001/03/06 02:15:04 obrien Exp $
a40 1
echo "+++ mfs_mount of /var"
a43 1
echo "+++ mfs_mount of /var"
d48 3
a50 1
chmod 755 /var/run /var/db /var/spool
a53 2

mount -a       # chown and chgrp are in /usr
d58 3
a60 5
# We assume that /tmp is symlinked to /var/tmp on the shared root
# partition. mount_null seems to have problems.
#if [ ! -h /tmp -a ! -h /var/tmp ]; then
#	mount_null /var/tmp /tmp
#fi
a63 1
echo "+++ mount_mfs of /dev"
@


1.5.2.6
log
@(This is an intentional direct commit to -stable.  The MFS stuff
 doesn't really apply to -current anymore.)

Populate and set permissions on /var using mtree and
/etc/mtree/BSD.var.dist instead of hardcoding the directories and
permissions within this script.

Create initial log files based on the contents of /etc/newsyslog.conf.

Reviewed by:	luigi
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.5 2001/04/17 15:52:28 luigi Exp $
d43 11
a53 9

echo "+++ populate /var using /etc/mtree/BSD.var.dist"
/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var

echo "+++ create log files based on the contents of /etc/newsyslog.conf"
LOGFILES=`/usr/bin/awk '$1 != "#" { printf "%s ", $1 } ' /etc/newsyslog.conf`
if [ -n "$LOGFILES" ]; then
	/usr/bin/touch $LOGFILES
fi
a55 1

@


1.5.2.7
log
@MFC: /etc bootstrap simplifications, ability to make /tmp a seperate
     memory filesystem, minimize differences between -current and
     releng_4.
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.6 2001/04/22 23:14:46 bsd Exp $
a31 14
# Provide a function for normalizing the mounting of memory
# filesystems.  This should allow the rest of the code here to remain
# as close as possible between 5-current and 4-stable.
#   $1 = size
#   $2 = mount point
#   $3 = md unit number (ignored in pre 5.0 systems)
#   $4 = (optional) bytes-per-inode
mount_md() {
	if [ -n "$4" ]; then
		bpi="-i $4"
	fi
	/sbin/mount_mfs -s $1 -T qp120at $bpi dummy $2
}

d42 1
a42 1
mount_md ${varsize:=65536} /var 1
d59 11
a69 15
# If /tmp is a symlink, assume it points to somewhere writable, like
# /var/tmp, otherwise, use a small memory filesystem for /tmp.
if [ ! -h /tmp ]; then
	mount_md ${tmpsize:=20480} /tmp 2
fi

if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
	# we have DEVFS, no worries...
	true
else
	# extract a list of device entries, then copy them to a writable fs
	(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
	mount_md 4096 /dev 3 512
	(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
fi
@


1.5.2.8
log
@Removing old, broken DEVFS from -stable phase one: remove support
code, everything under #ifdef DEVFS (and thus opt_devfs.h), and most
references to the DEVFS routines.  Code that really couldn't be
reached was left alone.  Removal of the actual DEVFS implementation
will come later.

Approved by:	-stable
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.7 2001/05/11 17:46:57 bsd Exp $
d79 9
a87 4
# extract a list of device entries, then copy them to a writable fs
(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
mount_md 4096 /dev 3 512
(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
@


1.5.2.9
log
@MFC Rev 1.13, ensure that /var/log/lastlog exists so that login
doesn't complain.
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.8 2001/07/24 09:49:37 dd Exp $
a65 3

echo "+++ create lastlog"
/usr/bin/touch /var/log/lastlog
@


1.5.2.10
log
@Fix the scripts for diskless boot. Apart from various changes in the
comments to reflect reality and explain the boot process a bit better,
the main changes are the following:

rc.diskless1:
	Use -b 4096 -f 1024 as mount parameters, and increase the
	/etc MFS partition size to 8192 blocks.
	Initially populate /etc from /conf/base/etc

rc.diskless2:
	Use -b 4096 -f 1024 as mount parameters, move "mount -a"
	up a bit so various utilities located in /usr can be
	actually run when /usr is not on the same filesystem as /
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.9 2001/11/02 23:20:43 bsd Exp $
d43 1
a43 1
	/sbin/mount_mfs -s $1 -T qp120at -b 4096 -f 1024 $bpi dummy $2
a57 2
mount -a       # chown and chgrp are in /usr

d69 2
@


1.5.2.11
log
@Make the fs use 8k/1k blocks as 4:1 ratios are reported to
give trouble sometimes. Probably 4096/512 would be ok too, but
since i do not have a chance now to test it thoroughly i prefer
to stay on the safe side (8k/1k is what was used before 4.5).

Suggested-by: Warner Losh
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.10 2002/02/12 17:25:11 luigi Exp $
d43 1
a43 1
	/sbin/mount_mfs -s $1 -T qp120at -b 8192 -f 1024 $bpi dummy $2
@


1.5.2.12
log
@Two [minor] performance fixes for diskless configurations:
when copying large trees into /etc and /dev, try to fetch the
content from a cpio archive if there is one available, so the
operation does not take multiple RTTs for each individual file.
clone_root has been updated to generate the cpio archives,
rc.diskless* to make use of them.

Not committed to -current yet because the relevant files are
already slightly different in the two branches, and I would like
to have a chance to test it there first before resyncing the two
versions.
@
text
@d25 1
a25 1
# $FreeBSD: src/etc/rc.diskless2,v 1.5.2.11 2002/02/12 18:36:23 luigi Exp $
d82 2
a83 9
# Extract a list of device entries, then copy them to a writable fs.
# The list can be long, so if there is already a cpio archive prepared
# for us, use that one instead.

if [ -f /conf/dev.cpio.gz ] ; then
	ln -s /conf/dev.cpio.gz /tmp/dev.cpio.gz
else
	(cd /; find -x dev | cpio --create -H newc | gzip) > /tmp/dev.cpio.gz
fi
d85 1
a85 1
(cd /; gzip -dc /tmp/dev.cpio.gz | cpio --extract -H newc -d )
@


1.5.2.13
log
@MFC Rev 1.19: Create sendmail required directories if sendmail is
              enabled.

PR:	misc/39350
@
text
@d25 1
a25 1
# $FreeBSD$
a61 7
case ${sendmail_enable} in
[Nn][Oo][Nn][Ee])
	;;
*)
	/usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p /
	;;
esac
@


1.4
log
@Add/adjust some $FreeBSD$ tags.

Noted by:	Doug <Doug@@gorean.org>
@
text
@d1 1
a1 1
# $FreeBSD: src/etc/rc.diskless2,v 1.3 1999/09/13 15:44:18 sheldonh Exp $
d14 7
a20 4
mount_mfs -s ${var_run_sectors:=2048} -T qp120at dummy /var/run
mount_mfs -s ${var_db_sectors:=16384} -T qp120at dummy /var/db
mount_mfs -s ${var_tmp_sectors:=65536} -T qp120at dummy /var/tmp
mount_mfs -s ${var_spool_sectors:=65536} -T qp120at dummy /var/spool
d25 5
d35 1
a35 7
mkdir /var/spool/mqueue
mkdir /var/spool/lpd
mkdir /var/spool/output
mkdir /var/spool/output/lpd
chown -R root.daemon /var/spool/output
chgrp daemon /var/spool/lpd

@


1.3
log
@Apply a consistent style to most of the etc scripts.  Particularly, use
case instead of test where appropriate, since case allows case is a sh
builtin and (as a side-effect) allows case-insensitivity.

Changes discussed on freebsd-hackers.

Submitted by:	Doug Barton <Doug@@gorean.org>
@
text
@d1 1
a1 2
#
#$FreeBSD$
@


1.2
log
@Use /etc/defaults/rc.conf everywhere, falling back to /etc/rc.conf
as necessary (for half-assed upgrades).
@
text
@d1 3
d9 1
a9 1
if [ -f /etc/defaults/rc.conf ]; then
d11 1
a11 1
elif [ -f /etc/rc.conf ]; then
d35 1
a35 1
( cd /; find -x dev | cpio -o -H newc ) > /tmp/dev.tmp
d37 1
a37 2
( cd /; cpio -i -H newc -d < /tmp/dev.tmp )

@


1.2.2.1
log
@MFC: bring support for diskless in RELENG_3
@
text
@d12 4
a15 7
mount_mfs -s ${varsize:=65536} -T qp120at dummy /var
var_dirs="run dev db msgs tmp spool spool/mqueue spool/lpd spool/output \
	spool/output/lpd"
for i in $var_dirs
do
    mkdir /var/$i
done
a19 5
chown -R root.daemon /var/spool/output
chgrp daemon /var/spool/lpd
#
# XXX make sure to create one dir for each printer as requested by lpd
#
d25 7
a31 1
# extract a list of device entries, then copy them to a writable partition
@


1.1
log
@    Revamp rc.diskless.  Split into rc.diskless1 and rc.diskless2.  provide
    more opportunities for overriding.  Clean up /etc/rc ( remove conf_dir,
    remove startup mount special cases, remove other special cases )
@
text
@d6 4
a9 3

if [ -f /etc/rc.conf ]; then
        . /etc/rc.conf
@

