xref: /netbsd-src/etc/rc.d/mountall (revision a8c74629f602faa0ccf8a463757d7baf858bbf3a)
1#!/bin/sh
2#
3# $NetBSD: mountall,v 1.13 2020/03/01 15:22:55 roy Exp $
4#
5
6# REQUIRE: mountcritremote named ypbind
7# PROVIDE: mountall
8
9$_rc_subr_loaded . /etc/rc.subr
10
11name="mountall"
12start_cmd="mountall_start"
13stop_cmd="mountall_stop"
14
15mountall_start()
16{
17	echo 'Mounting all file systems...'
18
19	# Mount ZFS filesystems first because fstab
20	# may try and null mount paths on ZFS.
21	if checkyesno zfs; then
22		zfs mount -a
23	fi
24
25	# Mount file systems noted in fstab.
26	mount -a
27}
28
29mountall_stop()
30{
31	echo 'Unmounting all file systems...'
32	# Unmount file systems noted in fstab.
33	umount -a
34
35	# Unmount ZFS file systems.
36	if checkyesno zfs; then
37		zfs unmount -a
38	fi
39}
40
41load_rc_config $name
42run_rc_command "$1"
43