head	1.20;
access;
symbols
	RELENG_8_4:1.20.0.2
	RELENG_9_1_0_RELEASE:1.15.2.2.2.2
	RELENG_9_1:1.15.2.2.0.2
	RELENG_9_1_BP:1.15.2.2
	RELENG_8_3_0_RELEASE:1.13.10.4.2.1
	RELENG_8_3:1.13.10.4.0.2
	RELENG_8_3_BP:1.13.10.4
	RELENG_9_0_0_RELEASE:1.15.2.1.2.1
	RELENG_9_0:1.15.2.1.0.2
	RELENG_9_0_BP:1.15.2.1
	RELENG_9:1.15.0.2
	RELENG_9_BP:1.15
	RELENG_7_4_0_RELEASE:1.13.2.1.2.1
	RELENG_8_2_0_RELEASE:1.13.10.2.4.1
	RELENG_7_4:1.13.2.1.0.2
	RELENG_7_4_BP:1.13.2.1
	RELENG_8_2:1.13.10.2.0.4
	RELENG_8_2_BP:1.13.10.2
	RELENG_8_1_0_RELEASE:1.13.10.2.2.1
	RELENG_8_1:1.13.10.2.0.2
	RELENG_8_1_BP:1.13.10.2
	RELENG_7_3_0_RELEASE:1.13.12.1
	RELENG_7_3:1.13.0.12
	RELENG_7_3_BP:1.13
	RELENG_8_0_0_RELEASE:1.13.10.1.2.1
	RELENG_8_0:1.13.10.1.0.2
	RELENG_8_0_BP:1.13.10.1
	RELENG_8:1.13.0.10
	RELENG_8_BP:1.13
	RELENG_7_2_0_RELEASE:1.13.8.1
	RELENG_7_2:1.13.0.8
	RELENG_7_2_BP:1.13
	RELENG_7_1_0_RELEASE:1.13.6.1
	RELENG_6_4_0_RELEASE:1.8.2.4.4.1
	RELENG_7_1:1.13.0.6
	RELENG_7_1_BP:1.13
	RELENG_6_4:1.8.2.4.0.4
	RELENG_6_4_BP:1.8.2.4
	RELENG_7_0_0_RELEASE:1.13
	RELENG_6_3_0_RELEASE:1.8.2.4
	RELENG_7_0:1.13.0.4
	RELENG_7_0_BP:1.13
	RELENG_6_3:1.8.2.4.0.2
	RELENG_6_3_BP:1.8.2.4
	RELENG_7:1.13.0.2
	RELENG_7_BP:1.13
	RELENG_6_2_0_RELEASE:1.8.2.2
	RELENG_6_2:1.8.2.2.0.4
	RELENG_6_2_BP:1.8.2.2
	RELENG_5_5_0_RELEASE:1.6.2.2
	RELENG_5_5:1.6.2.2.0.2
	RELENG_5_5_BP:1.6.2.2
	RELENG_6_1_0_RELEASE:1.8.2.2
	RELENG_6_1:1.8.2.2.0.2
	RELENG_6_1_BP:1.8.2.2
	RELENG_6_0_0_RELEASE:1.8.2.1
	RELENG_6_0:1.8.2.1.0.2
	RELENG_6_0_BP:1.8.2.1
	RELENG_6:1.8.0.2
	RELENG_6_BP:1.8
	RELENG_5_4_0_RELEASE:1.6.2.1
	RELENG_5_4:1.6.2.1.0.4
	RELENG_5_4_BP:1.6.2.1
	RELENG_5_3_0_RELEASE:1.6.2.1
	RELENG_5_3:1.6.2.1.0.2
	RELENG_5_3_BP:1.6.2.1
	RELENG_5:1.6.0.2
	RELENG_5_BP:1.6
	RELENG_5_2_1_RELEASE:1.5
	RELENG_5_2_0_RELEASE:1.5
	RELENG_5_2:1.5.0.2
	RELENG_5_2_BP:1.5
	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;
locks; strict;
comment	@# @;


1.20
date	2012.11.17.01.49.04;	author svnexp;	state Exp;
branches
	1.20.2.1;
next	1.19;

1.19
date	2012.09.11.05.04.59;	author obrien;	state Exp;
branches;
next	1.18;

1.18
date	2012.07.13.06.46.09;	author kevlo;	state Exp;
branches;
next	1.17;

1.17
date	2012.02.11.20.47.16;	author ed;	state Exp;
branches;
next	1.16;

1.16
date	2012.01.14.02.18.41;	author dougb;	state Exp;
branches;
next	1.15;

1.15
date	2010.05.14.04.53.57;	author dougb;	state Exp;
branches
	1.15.2.1;
next	1.14;

1.14
date	2010.01.13.19.07.48;	author ed;	state Exp;
branches;
next	1.13;

1.13
date	2007.05.24.05.58.20;	author rse;	state Exp;
branches
	1.13.2.1
	1.13.6.1
	1.13.8.1
	1.13.10.1
	1.13.12.1;
next	1.12;

1.12
date	2007.04.02.22.53.07;	author des;	state Exp;
branches;
next	1.11;

1.11
date	2005.12.19.10.57.00;	author dougb;	state Exp;
branches;
next	1.10;

1.10
date	2005.08.08.09.46.09;	author pjd;	state Exp;
branches;
next	1.9;

1.9
date	2005.08.07.23.10.32;	author pjd;	state Exp;
branches;
next	1.8;

1.8
date	2005.04.14.03.56.06;	author csjp;	state Exp;
branches
	1.8.2.1;
next	1.7;

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

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

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

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

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

1.2
date	2002.10.12.10.31.31;	author schweikh;	state Exp;
branches;
next	1.1;

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

1.20.2.1
date	2012.11.17.01.49.04;	author svnexp;	state dead;
branches;
next	1.20.2.2;

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

1.15.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.15.2.1.2.1;
next	1.15.2.2;

1.15.2.2
date	2012.02.14.10.16.56;	author dougb;	state Exp;
branches
	1.15.2.2.2.1;
next	1.15.2.3;

1.15.2.3
date	2012.10.26.18.06.49;	author obrien;	state Exp;
branches;
next	1.15.2.4;

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

1.15.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.15.2.1.2.2;

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

1.15.2.2.2.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.15.2.2.2.2;

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

1.13.2.1
date	2010.05.14.19.36.11;	author dougb;	state Exp;
branches
	1.13.2.1.2.1;
next	1.13.2.2;

1.13.2.2
date	2012.02.14.10.17.30;	author dougb;	state Exp;
branches;
next	1.13.2.3;

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

1.13.2.1.2.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.13.2.1.2.2;

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

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

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

1.13.10.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.13.10.1.2.1;
next	1.13.10.2;

1.13.10.2
date	2010.05.14.19.28.16;	author dougb;	state Exp;
branches
	1.13.10.2.2.1
	1.13.10.2.4.1;
next	1.13.10.3;

1.13.10.3
date	2012.02.10.10.18.30;	author dougb;	state Exp;
branches;
next	1.13.10.4;

1.13.10.4
date	2012.02.14.10.17.14;	author dougb;	state Exp;
branches
	1.13.10.4.2.1;
next	1.13.10.5;

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

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

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

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

1.13.10.4.2.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.13.10.4.2.2;

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

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

1.8.2.1
date	2005.08.16.08.41.30;	author pjd;	state Exp;
branches;
next	1.8.2.2;

1.8.2.2
date	2006.01.17.06.37.48;	author dougb;	state Exp;
branches;
next	1.8.2.3;

1.8.2.3
date	2007.05.24.16.14.37;	author des;	state Exp;
branches;
next	1.8.2.4;

1.8.2.4
date	2007.10.25.14.58.33;	author mtm;	state Exp;
branches
	1.8.2.4.4.1;
next	1.8.2.5;

1.8.2.5
date	2010.05.14.19.57.18;	author dougb;	state Exp;
branches;
next	1.8.2.6;

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

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

1.6.2.1
date	2004.10.10.09.50.53;	author mtm;	state Exp;
branches;
next	1.6.2.2;

1.6.2.2
date	2005.05.01.01.28.57;	author csjp;	state Exp;
branches;
next	;


desc
@@


1.20
log
@Switching exporter and resync
@
text
@#!/bin/sh
#
# $FreeBSD: head/etc/rc.d/cleanvar 240336 2012-09-11 05:04:59Z obrien $
#

# PROVIDE: cleanvar
# REQUIRE: var

. /etc/rc.subr

name="cleanvar"
rcvar="cleanvar_enable"

start_precmd="${name}_prestart"
start_cmd="${name}_start"
stop_cmd=":"

extra_commands="reload"
reload_cmd="${name}_start"

purgedir()
{
	local dir file

	if [ $# -eq 0 ]; then
		purgedir .
	else
		for dir
		do
		(
			cd "$dir" && for file in .* *
			do
				# Skip over logging sockets
				[ -S "$file" -a "$file" = "log" ] && continue
				[ -S "$file" -a "$file" = "logpriv" ] && continue
				[ ."$file" = .. -o ."$file" = ... ] && continue
				if [ -d "$file" -a ! -L "$file" ]
				then
					purgedir "$file"
				else
					rm -f -- "$file"
				fi
			done
		)
		done
	fi
}

cleanvar_prestart()
{
	# These files must be removed only the first time this script is run
	# on boot.
	#
	rm -f /var/run/clean_var /var/spool/lock/clean_var
}

cleanvar_start()
{
	if [ -d /var/run -a ! -f /var/run/clean_var ]; then
		purgedir /var/run
		>/var/run/clean_var
	fi
	if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then
		purgedir /var/spool/lock
		>/var/spool/lock/clean_var
	fi
	rm -rf /var/spool/uucp/.Temp/*
}

load_rc_config $name
run_rc_command "$1"
@


1.20.2.1
log
@file cleanvar was added on branch RELENG_8_4 on 2013-03-28 13:02:43 +0000
@
text
@d1 71
@


1.20.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 73
#!/bin/sh
#
# $FreeBSD: releng/8.4/etc/rc.d/cleanvar 231655 2012-02-14 10:17:14Z dougb $
#

# PROVIDE: cleanvar
# REQUIRE: FILESYSTEMS var addswap

. /etc/rc.subr

name="cleanvar"
rcvar="cleanvar_enable"

start_precmd="${name}_prestart"
start_cmd="${name}_start"
stop_cmd=":"

extra_commands="reload"
reload_cmd="${name}_start"

purgedir()
{
	local dir file

	if [ $# -eq 0 ]; then
		purgedir .
	else
		for dir
		do
		(
			cd "$dir" && for file in .* *
			do
				# Skip over logging sockets
				[ -S "$file" -a "$file" = "log" ] && continue
				[ -S "$file" -a "$file" = "logpriv" ] && continue
				[ ."$file" = .. -o ."$file" = ... ] && continue
				if [ -d "$file" -a ! -L "$file" ]
				then
					purgedir "$file"
				else
					rm -f -- "$file"
				fi
			done
		)
		done
	fi
}

cleanvar_prestart()
{
	# These files must be removed only the first time this script is run
	# on boot.
	#
	rm -f /var/run/clean_var /var/spool/lock/clean_var
}

cleanvar_start ()
{
	if [ -d /var/run -a ! -f /var/run/clean_var ]; then
		purgedir /var/run
		# And an initial utmp file
		(cd /var/run && cp /dev/null utmp && chmod 644 utmp)
		>/var/run/clean_var
	fi
	if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then
		purgedir /var/spool/lock
		>/var/spool/lock/clean_var
	fi
	rm -rf /var/spool/uucp/.Temp/*
}

load_rc_config $name
run_rc_command "$1"
@


1.19
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
@d3 1
a3 1
# $FreeBSD$
@


1.18
log
@SVN rev 238416 on 2012-07-13 06:46:09Z by kevlo

Whitespace nit
@
text
@d7 1
a7 1
# REQUIRE: FILESYSTEMS var
@


1.17
log
@SVN rev 231534 on 2012-02-11 20:47:16Z by ed

Move utmpx handling out of init(8).

This has the following advantages:

- During boot, the BOOT_TIME record is now written right after the file
  systems become writable, but before users are allowed to log in. This
  means that they can't cause `hidden logins' by logging in right before
  init(8) kicks in.

- The pututxline(3) function may potentially block on file locking,
  though this is very rare to occur. By placing it in an rc script, the
  user can still kill it with ^C if needed.

- Most importantly: jails don't use init(8). This means that a force
  reboot of a system running jails will leave stale entries in the
  accounting database of the jails individually.
@
text
@d57 1
a57 1
cleanvar_start ()
@


1.16
log
@SVN rev 230099 on 2012-01-14 02:18:41Z by dougb

Prepare for the removal of set_rcvar() by changing the rcvar=
assignments to the literal values it would have returned.

The concept of set_rcvar() was nice in theory, but the forks
it creates are a drag on the startup process, which is especially
noticeable on slower systems, such as embedded ones.

During the discussion on freebsd-rc@@ a preference was expressed for
using ${name}_enable instead of the literal values. However the
code portability concept doesn't really apply since there are so
many other places where the literal name has to be searched for
and replaced. Also, using the literal value is also a tiny bit
faster than dereferencing the variables, and every little bit helps.
@
text
@a60 2
		# And an initial utmpx active session file
		(cd /var/run && cp /dev/null utx.active && chmod 644 utx.active)
@


1.15
log
@SVN rev 208060 on 2010-05-14 04:53:57Z by dougb

Remove trailing white space. No functional changes.
@
text
@d12 1
a12 1
rcvar=`set_rcvar`
@


1.15.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.15.2.2
log
@SVN rev 231653 on 2012-02-14 10:16:56Z by dougb

MFC r230099:

Change rcvar= assignments to the literal values set_rcvar
would have returned. This will slightly reduce boot time,
and help in diff reduction to HEAD.
@
text
@d12 1
a12 1
rcvar="cleanvar_enable"
@


1.15.2.3
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
@d7 1
a7 1
# REQUIRE: var
@


1.15.2.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/cleanvar 242153 2012-10-26 18:06:49Z obrien $
@


1.15.2.2.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.15.2.2.2.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/9.1/etc/rc.d/cleanvar 231653 2012-02-14 10:16:56Z dougb $
@


1.15.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.15.2.1.2.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/9.0/etc/rc.d/cleanvar 208060 2010-05-14 04:53:57Z dougb $
@


1.14
log
@SVN rev 202218 on 2010-01-13 19:07:48Z by ed

Let rc and periodic infrastructure and newsyslog use the utmpx files.
@
text
@d57 1
a57 1
cleanvar_start () 
@


1.13
log
@Remove two superfluous trailing semicolons.
@
text
@d61 2
a62 2
		# And an initial utmp file
		(cd /var/run && cp /dev/null utmp && chmod 644 utmp)
@


1.13.2.1
log
@SVN rev 208095 on 2010-05-14 19:36:11Z by dougb

MFC 208060:

Remove trailing white space. No functional changes.

Hand-delete trailing ws from rc.firewall while I'm here.
@
text
@d57 1
a57 1
cleanvar_start ()
@


1.13.2.2
log
@SVN rev 231656 on 2012-02-14 10:17:30Z by dougb

MFC r230099:

Change rcvar= assignments to the literal values set_rcvar
would have returned. This will slightly reduce boot time,
and help in diff reduction to HEAD.
@
text
@d12 1
a12 1
rcvar="cleanvar_enable"
@


1.13.2.3
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: stable/7/etc/rc.d/cleanvar 231656 2012-02-14 10:17:30Z dougb $
@


1.13.2.1.2.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.13.2.1.2.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/7.4/etc/rc.d/cleanvar 208095 2010-05-14 19:36:11Z dougb $
@


1.13.12.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.13.10.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.10.2
log
@SVN rev 208094 on 2010-05-14 19:28:16Z by dougb

MFC 208060:

Remove trailing white space. No functional changes.
@
text
@d57 1
a57 1
cleanvar_start ()
@


1.13.10.3
log
@SVN rev 231372 on 2012-02-10 10:18:30Z by dougb

MFC r208307:

This change does the following for the scripts that run up through
FILESYSTEMS (the default early_late_divider):
1. Move sysctl to run first
2. Move as many BEFOREs to REQUIREs as possible.
3. Minor effect, move hostid_save from right before mdconfig to right
   after.

A lot of the early scripts make use of sysctl one way or another so
running this first makes a lot of sense given that system-critical
values are often placed in sysctl.conf. (More details in original log.)

In addition to the changes from this revision, tweak a few other rcorder
elements in order to minimize the differences between the order before
and after this change, mostly related to scripts still in this branch
that are no longer in HEAD.
@
text
@d7 1
a7 1
# REQUIRE: FILESYSTEMS var addswap
@


1.13.10.4
log
@SVN rev 231655 on 2012-02-14 10:17:14Z by dougb

MFC r230099:

Change rcvar= assignments to the literal values set_rcvar
would have returned. This will slightly reduce boot time,
and help in diff reduction to HEAD.
@
text
@d12 1
a12 1
rcvar="cleanvar_enable"
@


1.13.10.5
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/cleanvar 231655 2012-02-14 10:17:14Z dougb $
@


1.13.10.4.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.13.10.4.2.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/8.3/etc/rc.d/cleanvar 231655 2012-02-14 10:17:14Z dougb $
@


1.13.10.2.4.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.10.2.2.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.10.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.13.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.13.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.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
@d62 1
a62 1
		(cd /var/run && cp /dev/null utmp && chmod 644 utmp;)
@


1.11
log
@Clear up problems with /etc/rc.d/{abi|cleanvar|cleartmp} brought
to light by the PR.  Specifically, convert these three scripts
into good rc.d citizens, making sure that their functionality
is preserved, but the rc.d framework rules are not broken.

Add support for cleanvar as a regular rc.d script in the
default rc.conf, and document this in the man page.

Add a descriptive comment to rc.conf that regarding the
three emulation/compatibility services provided by abi
so users will not be confused by these services not having
their own startup scripts.

PR:		conf/84574
Submitted by:	Alexander Botero-Lowry
@
text
@d7 1
a7 1
# REQUIRE: mountcritlocal var
@


1.10
log
@Back-out previous commit - we need to skip logging socket when we start a
jail and external syslogd is listening in jail's chroot.

Pointed out by:	csjp

While here, skip also "logpriv" socket.
@
text
@d9 12
d49 22
a70 16
# These files must be removed only the first time this script is run
# on boot.
#
[ "$1" != "reload" ] && rm -f /var/run/clean_var /var/spool/lock/clean_var

if [ -d /var/run -a ! -f /var/run/clean_var ]; then
	purgedir /var/run
	# And an initial utmp file
	(cd /var/run && cp /dev/null utmp && chmod 644 utmp;)
	>/var/run/clean_var
fi
if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then
	purgedir /var/spool/lock
	>/var/spool/lock/clean_var
fi
rm -rf /var/spool/uucp/.Temp/*
d72 2
@


1.9
log
@We don't need to skip /var/run/log socket, as syslogd is always started
after rc.d/cleanvar. And if we wanted to skip /var/run/log we still needed
to skip /var/run/logpriv, which wasn't implemented.
@
text
@d21 3
@


1.8
log
@Do not remove logging sockets. This fixes an issue where logging
sockets placed into prisons from the host environment get clobbered
by the prison's instance of cleanvar. (assuming /etc/rc is run in
the prison).

Discussed with:	pjd, green, cperciva
MFC after:	1 week
@
text
@a20 2
				# Skip over logging sockets
				[ -S "$file" -a "$file" = "log" ] && continue
@


1.8.2.1
log
@MFC:	rc.d/cleanvar	1.10

Skip 'logpriv' socket when cleaning /var/.

Approved by:	re (kensmith)
@
text
@a22 1
				[ -S "$file" -a "$file" = "logpriv" ] && continue
@


1.8.2.2
log
@MFC changes to have these scripts follow proper rc.d syntax

PR:		conf/84574
Submitted by:	Alexander Botero-Lowry
@
text
@a8 12
. /etc/rc.subr

name="cleanvar"
rcvar=`set_rcvar`

start_precmd="${name}_prestart"
start_cmd="${name}_start"
stop_cmd=":"

extra_commands="reload"
reload_cmd="${name}_start"

d37 16
a52 22
cleanvar_prestart()
{
	# These files must be removed only the first time this script is run
	# on boot.
	#
	rm -f /var/run/clean_var /var/spool/lock/clean_var
}

cleanvar_start () 
{
	if [ -d /var/run -a ! -f /var/run/clean_var ]; then
		purgedir /var/run
		# And an initial utmp file
		(cd /var/run && cp /dev/null utmp && chmod 644 utmp;)
		>/var/run/clean_var
	fi
	if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then
		purgedir /var/spool/lock
		>/var/spool/lock/clean_var
	fi
	rm -rf /var/spool/uucp/.Temp/*
}
a53 2
load_rc_config $name
run_rc_command "$1"
@


1.8.2.3
log
@MFC: add FILESYSTEMS
@
text
@d7 1
a7 1
# REQUIRE: FILESYSTEMS var
@


1.8.2.4
log
@MFC:
    rc.d/var rc.d/tmp:
    Remove unnecessary subshell constructs.

    rc.d/clean rc.d/initrandom:
    Remove unnecessary semi-colon at the end of a command line.
@
text
@d62 1
a62 1
		(cd /var/run && cp /dev/null utmp && chmod 644 utmp)
@


1.8.2.5
log
@SVN rev 208096 on 2010-05-14 19:57:18Z by dougb

MFC 208060:

Remove trailing white space. No functional changes.

Hand-delete trailing ws from rc.subr, rc.d/nsswitch, and rc.d/nfslocking
while I'm here.
@
text
@d57 1
a57 1
cleanvar_start ()
@


1.8.2.6
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: stable/6/etc/rc.d/cleanvar 208096 2010-05-14 19:57:18Z dougb $
@


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

Discussed with: dougb, brooks
MFC after: 3 days
@
text
@d21 2
@


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
@a7 1
# KEYWORD: FreeBSD
@


1.6.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
@d8 1
@


1.6.2.2
log
@MFC revision 1.8
date: 2005/04/14 03:56:06;  author: csjp;  state: Exp;  lines: +2 -0
Do not remove logging sockets. This fixes an issue where logging
sockets placed into prisons from the host environment get clobbered
by the prison's instance of cleanvar. (assuming /etc/rc is run in
the prison).
@
text
@a20 2
				# Skip over logging sockets
				[ -S "$file" -a "$file" = "log" ] && continue
@


1.5
log
@Make sure ipmon is run after cleaning up in /var. Otherwise,
we would lose it's pid file. Also, cleanup the depencies in
rc.d/cleanvar

PR: bin/53516
@
text
@d7 1
a7 1
# REQUIRE: mountcritlocal
@


1.4
log
@o Hook the new files up to the build.
o Make sure all the scripts reference rc.d/netif and not rc.d/network1

Approved by:	markm (mentor)
@
text
@d7 1
a7 2
# REQUIRE: adjkerntz mountcritlocal
# BEFORE: netif
@


1.3
log
@When cleaning /var/run make sure the control files are not removed
unconditionally when the script is being rerun (when it is called
with the reload argument).

PR:		conf/47517
Approved by:	markm (mentor)
@
text
@d8 1
a8 1
# BEFORE: network1
@


1.2
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
@d36 5
a40 1
rm -f /var/run/clean_var /var/spool/lock/clean_var
@


1.1
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
@d13 1
a13 1
        local dir file
@

