xref: /dflybsd-src/etc/rc.d/mountcritlocal (revision 0d5b3835ff48cf361a57f11f722767062fd85dd8)
1#!/bin/sh
2#
3# $NetBSD: mountcritlocal,v 1.7 2002/04/29 12:29:53 lukem Exp $
4# $FreeBSD: src/etc/rc.d/mountcritlocal,v 1.5 2003/06/01 01:43:37 gordon Exp $
5#
6
7# PROVIDE: mountcritlocal
8# REQUIRE: root
9
10. /etc/rc.subr
11
12name="mountcritlocal"
13start_cmd="mountcritlocal_start"
14stop_cmd=":"
15
16mountcritlocal_start()
17{
18	# Set up the list of network filesystem types for which mounting
19	# should be delayed until after network initialization.
20	case ${extra_netfs_types} in
21	[Nn][Oo])
22		;;
23	*)
24		netfs_types="${netfs_types} ${extra_netfs_types}"
25		;;
26	esac
27
28	# Mount everything except for network filesystems.
29	#
30	mount_excludes=""
31	for i in ${netfs_types}; do
32		fstype=${i%:*}
33		mount_excludes="${mount_excludes}${fstype},"
34	done
35	debug "mount -a -t no${mount_excludes%,}"
36	mount -a -t no${mount_excludes%,}
37	err=$?
38	if [ ${err} -ne 0 ]; then
39		echo 'Mounting /etc/fstab filesystems failed,' \
40		     'startup aborted'
41		exit ${err}
42	fi
43
44	# Mount /var/run/shm for shm_open() and friends
45	#
46	mount_tmpfs -m 01777 dummy /var/run/shm
47	mkdir -p -m 01777 /var/run/shm/tmp
48}
49
50load_rc_config $name
51run_rc_command "$1"
52