summaryrefslogtreecommitdiff
path: root/etc/rc.d/clearcritlocal
blob: 2883201ab2e0c4df8430963eb54f6b71e07fdce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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"