[BACK]Return to clearcritlocal CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

File: [cvs.NetBSD.org] / src / etc / rc.d / clearcritlocal (download)

Revision 1.3, Tue Sep 8 12:52:18 2020 UTC (3 years, 7 months ago) by martin
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, HEAD
Changes since 1.2: +2 -2 lines

Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems

#!/bin/sh
#
# $NetBSD: clearcritlocal,v 1.3 2020/09/08 12:52:18 martin Exp $
#

# REQUIRE: mountcritlocal
# BEFORE: CRITLOCALMOUNTED

$_rc_subr_loaded . /etc/rc.subr

name="clearcritlocal"
start_cmd="clearcritlocal_start"
stop_cmd=":"

clearcritlocal_start()
{
	#	clean up left-over files.
	#	this could include the cleanup of lock files and /var/run, etc.
	#
	rm -f /etc/nologin /var/spool/lock/LCK.*
	if [ -d /var/run ]; then
		cd /var/run && rm -rf -- *
	fi
	return 0
}

load_rc_config $name
run_rc_command "$1"