NetBSD/etc/rc.d/mountall
roy 5abb0d8844 mountall: Mount ZFS filesystems before fstab
This allows null mounts in fstab to reference fstab mounts.
It's highly unlikely ZFS mounts would reference anything outside of ZFS.
2020-03-01 15:22:55 +00:00

43 lines
701 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: mountall,v 1.13 2020/03/01 15:22:55 roy Exp $
#
# REQUIRE: mountcritremote named ypbind
# PROVIDE: mountall
$_rc_subr_loaded . /etc/rc.subr
name="mountall"
start_cmd="mountall_start"
stop_cmd="mountall_stop"
mountall_start()
{
echo 'Mounting all file systems...'
# Mount ZFS filesystems first because fstab
# may try and null mount paths on ZFS.
if checkyesno zfs; then
zfs mount -a
fi
# Mount file systems noted in fstab.
mount -a
}
mountall_stop()
{
echo 'Unmounting all file systems...'
# Unmount file systems noted in fstab.
umount -a
# Unmount ZFS file systems.
if checkyesno zfs; then
zfs unmount -a
fi
}
load_rc_config $name
run_rc_command "$1"