xref: /netbsd-src/etc/rc.d/mountcritlocal (revision e89934bbf778a6d6d6894877c4da59d0c7835b0f)
1#!/bin/sh
2#
3# $NetBSD: mountcritlocal,v 1.15 2016/07/23 01:38:35 kre Exp $
4#
5
6# PROVIDE: mountcritlocal
7# REQUIRE: fsck
8
9$_rc_subr_loaded . /etc/rc.subr
10
11name="mountcritlocal"
12start_cmd="mountcritlocal_start"
13stop_cmd=":"
14
15mountcritlocal_start()
16{
17	#	Mount critical file systems that are `local'
18	#	(as specified in $critical_filesystems_local)
19	#	This usually includes /var.
20	#
21	mount_critical_filesystems local || return $?
22
23	#	clean up left-over files.
24	#	this could include the cleanup of lock files and /var/run, etc.
25	#
26	rm -f /etc/nologin /var/spool/lock/LCK.*
27	test -d /var/run && (cd /var/run && rm -rf -- *)
28
29	#       create LVM locking directory, it needs to be owned by operator
30	#	group and has parmissions to allow lock file creation.
31	#
32	mkdir -p /var/run/lvm
33	chown root:operator /var/run/lvm
34	chmod 770 /var/run/lvm
35	return 0
36}
37
38load_rc_config $name
39run_rc_command "$1"
40