Merge branch 'vendor/DHCPCD'
[dragonfly.git] / etc / rc.d / mountcritlocal
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
12 name="mountcritlocal"
13 start_cmd="mountcritlocal_start"
14 stop_cmd=":"
15
16 mountcritlocal_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; startup aborted'
40                 stop_boot true
41         fi
42
43         # Mount /var/run/shm for shm_open() and friends
44         #
45         mount_tmpfs -m 01777 dummy /var/run/shm
46         mkdir -p -m 01777 /var/run/shm/tmp
47 }
48
49 load_rc_config $name
50 run_rc_command "$1"