head	1.16;
access;
symbols
	RELENG_8_4:1.16.0.2
	RELENG_9_1_0_RELEASE:1.14.2.1.4.2
	RELENG_9_1:1.14.2.1.0.4
	RELENG_9_1_BP:1.14.2.1
	RELENG_8_3_0_RELEASE:1.13.2.2.8.1
	RELENG_8_3:1.13.2.2.0.8
	RELENG_8_3_BP:1.13.2.2
	RELENG_9_0_0_RELEASE:1.14.2.1.2.1
	RELENG_9_0:1.14.2.1.0.2
	RELENG_9_0_BP:1.14.2.1
	RELENG_9:1.14.0.2
	RELENG_9_BP:1.14
	RELENG_7_4_0_RELEASE:1.12.12.1
	RELENG_8_2_0_RELEASE:1.13.2.2.6.1
	RELENG_7_4:1.12.0.12
	RELENG_7_4_BP:1.12
	RELENG_8_2:1.13.2.2.0.6
	RELENG_8_2_BP:1.13.2.2
	RELENG_8_1_0_RELEASE:1.13.2.2.4.1
	RELENG_8_1:1.13.2.2.0.4
	RELENG_8_1_BP:1.13.2.2
	RELENG_7_3_0_RELEASE:1.12.10.1
	RELENG_7_3:1.12.0.10
	RELENG_7_3_BP:1.12
	RELENG_8_0_0_RELEASE:1.13.2.2.2.1
	RELENG_8_0:1.13.2.2.0.2
	RELENG_8_0_BP:1.13.2.2
	RELENG_8:1.13.0.2
	RELENG_8_BP:1.13
	RELENG_7_2_0_RELEASE:1.12.8.1
	RELENG_7_2:1.12.0.8
	RELENG_7_2_BP:1.12
	RELENG_7_1_0_RELEASE:1.12.6.1
	RELENG_6_4_0_RELEASE:1.8.2.2.4.1
	RELENG_7_1:1.12.0.6
	RELENG_7_1_BP:1.12
	RELENG_6_4:1.8.2.2.0.4
	RELENG_6_4_BP:1.8.2.2
	RELENG_7_0_0_RELEASE:1.12
	RELENG_6_3_0_RELEASE:1.8.2.2
	RELENG_7_0:1.12.0.4
	RELENG_7_0_BP:1.12
	RELENG_6_3:1.8.2.2.0.2
	RELENG_6_3_BP:1.8.2.2
	RELENG_7:1.12.0.2
	RELENG_7_BP:1.12
	RELENG_6_2_0_RELEASE:1.8
	RELENG_6_2:1.8.0.8
	RELENG_6_2_BP:1.8
	RELENG_5_5_0_RELEASE:1.7.2.1
	RELENG_5_5:1.7.2.1.0.6
	RELENG_5_5_BP:1.7.2.1
	RELENG_6_1_0_RELEASE:1.8
	RELENG_6_1:1.8.0.6
	RELENG_6_1_BP:1.8
	RELENG_6_0_0_RELEASE:1.8
	RELENG_6_0:1.8.0.4
	RELENG_6_0_BP:1.8
	RELENG_6:1.8.0.2
	RELENG_6_BP:1.8
	RELENG_5_4_0_RELEASE:1.7.2.1
	RELENG_5_4:1.7.2.1.0.4
	RELENG_5_4_BP:1.7.2.1
	RELENG_5_3_0_RELEASE:1.7.2.1
	RELENG_5_3:1.7.2.1.0.2
	RELENG_5_3_BP:1.7.2.1
	RELENG_5:1.7.0.2
	RELENG_5_BP:1.7
	RELENG_5_2_1_RELEASE:1.3
	RELENG_5_2_0_RELEASE:1.3
	RELENG_5_2:1.3.0.2
	RELENG_5_2_BP:1.3
	RELENG_5_1_0_RELEASE:1.2
	RELENG_5_1:1.2.0.2
	RELENG_5_1_BP:1.2;
locks; strict;
comment	@# @;


1.16
date	2012.11.17.01.49.04;	author svnexp;	state Exp;
branches
	1.16.2.1;
next	1.15;

1.15
date	2012.01.08.20.25.29;	author dougb;	state Exp;
branches;
next	1.14;

1.14
date	2009.10.10.22.17.03;	author dougb;	state Exp;
branches
	1.14.2.1;
next	1.13;

1.13
date	2008.06.23.04.46.54;	author mtm;	state Exp;
branches
	1.13.2.1;
next	1.12;

1.12
date	2007.04.02.22.53.07;	author des;	state Exp;
branches
	1.12.2.1
	1.12.6.1
	1.12.8.1
	1.12.10.1
	1.12.12.1;
next	1.11;

1.11
date	2007.02.15.06.46.33;	author yar;	state Exp;
branches;
next	1.10;

1.10
date	2007.02.15.06.42.42;	author yar;	state Exp;
branches;
next	1.9;

1.9
date	2007.02.10.13.13.32;	author yar;	state Exp;
branches;
next	1.8;

1.8
date	2004.10.07.13.55.25;	author mtm;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	2004.04.02.12.18.40;	author krion;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2004.03.23.23.22.34;	author brooks;	state Exp;
branches;
next	1.5;

1.5
date	2004.03.05.09.18.40;	author pjd;	state Exp;
branches;
next	1.4;

1.4
date	2004.03.05.09.17.01;	author pjd;	state Exp;
branches;
next	1.3;

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

1.2
date	2003.04.24.08.20.47;	author mtm;	state Exp;
branches;
next	1.1;

1.1
date	2003.04.18.17.51.53;	author mtm;	state Exp;
branches;
next	;

1.16.2.1
date	2012.11.17.01.49.04;	author svnexp;	state dead;
branches;
next	1.16.2.2;

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

1.14.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.14.2.1.2.1
	1.14.2.1.4.1;
next	1.14.2.2;

1.14.2.2
date	2012.10.04.22.31.56;	author dougb;	state Exp;
branches;
next	1.14.2.3;

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

1.14.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.14.2.1.2.2;

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

1.14.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.14.2.1.4.2;

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

1.13.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches;
next	1.13.2.2;

1.13.2.2
date	2009.10.16.00.17.09;	author dougb;	state Exp;
branches
	1.13.2.2.2.1
	1.13.2.2.4.1
	1.13.2.2.6.1
	1.13.2.2.8.1;
next	1.13.2.3;

1.13.2.3
date	2012.10.04.22.32.12;	author dougb;	state Exp;
branches;
next	1.13.2.4;

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

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

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

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

1.13.2.2.8.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.13.2.2.8.2;

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

1.12.2.1
date	2012.10.04.22.32.27;	author dougb;	state Exp;
branches;
next	1.12.2.2;

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

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

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

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

1.12.12.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.12.12.2;

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

1.8.2.1
date	2007.03.10.14.17.27;	author yar;	state Exp;
branches;
next	1.8.2.2;

1.8.2.2
date	2007.05.24.16.14.37;	author des;	state Exp;
branches
	1.8.2.2.4.1;
next	1.8.2.3;

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

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

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


desc
@@


1.16
log
@Switching exporter and resync
@
text
@#!/bin/sh
#
# Copyright (c) 2003 The FreeBSD Project. 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 PROJECT 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 PROJECT 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/hostname 229822 2012-01-08 20:25:29Z dougb $
#

# PROVIDE: hostname
# REQUIRE: FILESYSTEMS
# BEFORE:  netif

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

name="hostname"
start_cmd="hostname_start"
stop_cmd=":"

hostname_start()
{
	# If we are not inside a jail, set the host name if it is not already set.
	# If we are inside a jail, set the host name even if it is already set,
	# but first check if it is permitted.
	#
	if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then
		if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then
			return
		fi
	elif [ -n "`/bin/hostname -s`" ]; then
		return
	else
		# If we're not in a jail and rc.conf doesn't specify a
		# hostname, see if we can get one from kenv.
		#
		if [ -z "${hostname}" -a \
		    -n "`/bin/kenv dhcp.host-name 2> /dev/null`" ]; then
			hostname=`/bin/kenv dhcp.host-name`
		fi
	fi

	# Have we got a hostname yet?
	#
	if [ -z "${hostname}" ]; then
		# Null hostname is probably OK if DHCP is in use.
		#
		if [ -z "`list_net_interfaces dhcp`" ]; then
			warn "\$hostname is not set -- see rc.conf(5)."
		fi
		return
	fi

	# All right, it is safe to invoke hostname(1) now.
	#
	check_startmsgs && echo -n "Setting hostname: ${hostname}"
	/bin/hostname "${hostname}"
	check_startmsgs && echo '.'
}

load_rc_config $name
run_rc_command "$1"
@


1.16.2.1
log
@file hostname was added on branch RELENG_8_4 on 2013-03-28 13:02:43 +0000
@
text
@d1 81
@


1.16.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 81
#!/bin/sh
#
# Copyright (c) 2003 The FreeBSD Project. 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 PROJECT 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 PROJECT 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/hostname 241209 2012-10-04 22:32:12Z dougb $
#

# PROVIDE: hostname
# REQUIRE: FILESYSTEMS
# BEFORE:  netif

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

name="hostname"
start_cmd="hostname_start"
stop_cmd=":"

hostname_start()
{
	# If we are not inside a jail, set the host name if it is not already set.
	# If we are inside a jail, set the host name even if it is already set,
	# but first check if it is permitted.
	#
	if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then
		if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then
			return
		fi
	elif [ -n "`/bin/hostname -s`" ]; then
		return
	else
		# If we're not in a jail and rc.conf doesn't specify a
		# hostname, see if we can get one from kenv.
		#
		if [ -z "${hostname}" -a \
		    -n "`/bin/kenv dhcp.host-name 2> /dev/null`" ]; then
			hostname=`/bin/kenv dhcp.host-name`
		fi
	fi

	# Have we got a hostname yet?
	#
	if [ -z "${hostname}" ]; then
		# Null hostname is probably OK if DHCP is in use.
		#
		if [ -z "`list_net_interfaces dhcp`" ]; then
			warn "\$hostname is not set -- see rc.conf(5)."
		fi
		return
	fi

	# All right, it is safe to invoke hostname(1) now.
	#
	check_startmsgs && echo -n "Setting hostname: ${hostname}"
	/bin/hostname "${hostname}"
	check_startmsgs && echo '.'
}

load_rc_config $name
run_rc_command "$1"
@


1.15
log
@SVN rev 229822 on 2012-01-08 20:25:29Z by dougb

There is no longer a need to abstract ${rcvar_manpage} as we are not
attempting to maintain compatibility with NetBSD for some years now.
@
text
@d26 1
a26 1
# $FreeBSD$
@


1.14
log
@SVN rev 197947 on 2009-10-10 22:17:03Z by dougb

In regards to the "Starting foo:" type messages at boot time, create and
employ a more generic solution, and use it in the individual rc.d scripts
that also have an $rc_quiet test:

1. Add check_startmsgs() to rc.subr.
2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute
variations of [ -z "$rc_quiet" ] with check_startmsgs
3. In savecore add a trailing '.' to the end of the message to make it
more consistent with other scripts.
4. In newsyslog remove a : before the terminal '.' since we do not expect
there to be anything printed out in between to make it more consistent.
5. In the following scripts change "quotes" to 'quotes' where no variables
exist in the message: savecore pf newsyslog
6. In the following scripts substitute if/then/fi for the simpler (and
more consistent) check_startmsgs &&: faith stf
7. In the following scripts separate the "Starting foo:" from the terminal
'.' to make them more consistent: moused hostname pf
8. In nfsclient move the message to its own line to avoid a style bug
9. In pf rc_quiet does not apply to the _stop method, so remove the
test there.
10. In motd add 'quotes' around the terminal '.' for consistency
@
text
@d68 1
a68 1
			warn "\$hostname is not set -- see ${rcvar_manpage}."
@


1.14.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.14.2.2
log
@SVN rev 241208 on 2012-10-04 22:31:56Z by dougb

MFC r229822:

There is no longer a need to abstract ${rcvar_manpage} as we are not
attempting to maintain compatibility with NetBSD for some years now.
@
text
@d68 1
a68 1
			warn "\$hostname is not set -- see rc.conf(5)."
@


1.14.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
@d26 1
a26 1
# $FreeBSD: stable/9/etc/rc.d/hostname 241208 2012-10-04 22:31:56Z dougb $
@


1.14.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.14.2.1.4.2
log
@Switch importer
@
text
@d26 1
a26 1
# $FreeBSD: releng/9.1/etc/rc.d/hostname 197947 2009-10-10 22:17:03Z dougb $
@


1.14.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.14.2.1.2.2
log
@Switch importer
@
text
@d26 1
a26 1
# $FreeBSD: releng/9.0/etc/rc.d/hostname 197947 2009-10-10 22:17:03Z dougb $
@


1.13
log
@SVN rev 179945 on 2008-06-23 04:46:54Z by mtm

Move a lot of diagnostic output behind $rc_quiet in scripts that
implement their own start command.
@
text
@d75 1
a75 1
	[ -z "${rc_quiet}" ] && echo "Setting hostname: ${hostname}."
d77 1
@


1.13.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.13.2.2
log
@SVN rev 198164 on 2009-10-16 00:17:09Z by dougb

MFC r197947:

In regards to the "Starting foo:" type messages at boot time, create
and employ a more generic solution, and use it in the individual rc.d
scripts that also have an $rc_quiet test:

1. Add check_startmsgs() to rc.subr.
2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute
variations of [ -z "$rc_quiet" ] with check_startmsgs
3. In savecore add a trailing '.' to the end of the message to make it
more consistent with other scripts.
4. In newsyslog remove a : before the terminal '.' since we do not
expect there to be anything printed out in between to make it more
consistent.
5. In the following scripts change "quotes" to 'quotes' where no
variables exist in the message: savecore pf newsyslog
6. [Does not apply in RELENG_8]
7. In the following scripts separate the "Starting foo:" from the
terminal '.' to make them more consistent: moused hostname pf
8. In nfsclient move the message to its own line to avoid a style bug
9. In pf rc_quiet does not apply to the _stop method, so remove the
test there.
10. In motd add 'quotes' around the terminal '.' for consistency

Approved by:	re (kib)
@
text
@d75 1
a75 1
	check_startmsgs && echo -n "Setting hostname: ${hostname}"
a76 1
	check_startmsgs && echo '.'
@


1.13.2.3
log
@SVN rev 241209 on 2012-10-04 22:32:12Z by dougb

MFC r229822:

There is no longer a need to abstract ${rcvar_manpage} as we are not
attempting to maintain compatibility with NetBSD for some years now.
@
text
@d68 1
a68 1
			warn "\$hostname is not set -- see rc.conf(5)."
@


1.13.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
@d26 1
a26 1
# $FreeBSD: stable/8/etc/rc.d/hostname 241209 2012-10-04 22:32:12Z dougb $
@


1.13.2.2.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.13.2.2.8.2
log
@Switch importer
@
text
@d26 1
a26 1
# $FreeBSD: releng/8.3/etc/rc.d/hostname 198164 2009-10-16 00:17:09Z dougb $
@


1.13.2.2.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.13.2.2.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.13.2.2.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.12
log
@Add a dummy script, FILESYSTEMS, which depends on root and mountcritlocal
and takes over mountcritlocal's role as the early / late divider.  This
makes it far easier to add rc scripts which need to run early, such as a
startup script for zfs, which is right around the corner.

This change should be a no-op; I have verified that the only change in
rcorder's output is the insertion of FILESYSTEMS immediately after
mountcritlocal.

MFC after:	3 weeks
@
text
@d75 1
a75 1
	echo "Setting hostname: ${hostname}."
@


1.12.2.1
log
@SVN rev 241210 on 2012-10-04 22:32:27Z by dougb

MFC r229822:

There is no longer a need to abstract ${rcvar_manpage} as we are not
attempting to maintain compatibility with NetBSD for some years now.
@
text
@d68 1
a68 1
			warn "\$hostname is not set -- see rc.conf(5)."
@


1.12.2.2
log
@Switch importer
@
text
@d26 1
a26 1
# $FreeBSD: stable/7/etc/rc.d/hostname 241210 2012-10-04 22:32:27Z dougb $
@


1.12.12.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.12.12.2
log
@Switch importer
@
text
@d26 1
a26 1
# $FreeBSD: releng/7.4/etc/rc.d/hostname 168283 2007-04-02 22:53:07Z des $
@


1.12.10.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.12.8.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.12.6.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.11
log
@Don't be paranoid about hostname(1) and order the things logically.

Pointed out by:	ceri
@
text
@d30 1
a30 1
# REQUIRE: mountcritlocal
@


1.10
log
@Don't nag about unset $hostname if DHCP is in use.

Pointed out by:	ceri
@
text
@d75 1
a76 1
	echo "Setting hostname: `hostname`."
@


1.9
log
@Handle the case when the admin forgot to set $hostname,
which can happen in new installations: advise to set the
variable and refer to rc.conf(5).
@
text
@d34 1
d65 5
a69 1
		warn "\$hostname is not set -- see ${rcvar_manpage}."
@


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

Discussed with: dougb, brooks
MFC after: 3 days
@
text
@d61 10
a70 1
	/bin/hostname ${hostname}
@


1.8.2.1
log
@MFC rev. 1.9-1.11:

Better handling for unset or null $hostname, which can appear
in a system just installed, or configured via DHCP.
@
text
@a33 1
. /etc/network.subr
d61 2
a62 15
	# Have we got a hostname yet?
	#
	if [ -z "${hostname}" ]; then
		# Null hostname is probably OK if DHCP is in use.
		#
		if [ -z "`list_net_interfaces dhcp`" ]; then
			warn "\$hostname is not set -- see ${rcvar_manpage}."
		fi
		return
	fi

	# All right, it is safe to invoke hostname(1) now.
	#
	echo "Setting hostname: ${hostname}."
	/bin/hostname "${hostname}"
@


1.8.2.2
log
@MFC: add FILESYSTEMS
@
text
@d30 1
a30 1
# REQUIRE: FILESYSTEMS
@


1.8.2.3
log
@Switch importer
@
text
@d26 1
a26 1
# $FreeBSD: stable/6/etc/rc.d/hostname 169945 2007-05-24 16:14:37Z des $
@


1.8.2.2.4.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.7
log
@- Use "/bin/hostname" explicitly instead of "hostname".

Approved by:	tobez
MFC after:	1 week
@
text
@a31 1
# KEYWORD: FreeBSD
@


1.7.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
@


1.6
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
@d50 1
a50 1
	elif [ -n "`hostname -s`" ]; then
d62 1
a62 1
	hostname ${hostname}
@


1.5
log
@One tab too much.
@
text
@d52 8
@


1.4
log
@Teach 'hostname' script how to act inside a jail.

No objections from:	mtm, arch@@
@
text
@d51 1
a51 1
			return
@


1.3
log
@tty whacking should occur early, but not so early that the
required commands are not on a mounted file system.

Noticed by: bde
@
text
@d42 3
a44 1
	# Set the host name if it is not already set
d46 6
a51 3
	if [ -z "`hostname -s`" ]; then
		hostname ${hostname}
		echo "Setting hostname: `hostname`."
d53 3
@


1.2
log
@Make ipfilter, ipnat, ipmon, and ipfs behave more like the old rc.
	o group them together so they run one right after another
	o use the NetBSD supplied ipfs script instead of tacking
	  it on to the end of ipnat
	o Load the ipl module in ipnat and ipfilter, if it's not already
	  loaded
	o In ipmon and ipnat show a warning if neither ipfilter nor
	  ipnat is enabled or the ipl module is not loaded, and exit

Approved by:	markm (mentor) (implicit)
Tested by:	leafy <leafy@@leafy.idv.tw>
@
text
@d30 1
a30 1
# REQUIRE: mountcritlocal tty
@


1.1
log
@Break out and rewrite the network setup scripts.
	o /etc/network.subr contains common subroutines used for seting
	  up network interfaces
	o rc.d/hostname sets the hostname if not already set
	o rc.d/nisdomain sets the nis domain *after* rpcbind but
	  before the yp* daemons. This fixes issues with temporary
	  hangs when looking up informaion in nis before it's ready.
	o rc.d/netif brings network interfaces (minus dhcp)  up.
	o rc.d/network1 has been disabled and will be retired before
	  RELENG_5. It will be replaced by rc.d/netif

Approved by:	markm (mentor)
@
text
@d30 1
a30 1
# REQUIRE: mountcritlocal sysctl tty
@

