NetBSD/etc/rc.d/mountall

51 lines
992 B
Plaintext
Raw Normal View History

2000-03-10 14:53:23 +03:00
#!/bin/sh
#
# $NetBSD: mountall,v 1.9 2014/07/22 17:11:09 wiz Exp $
2000-03-10 14:53:23 +03:00
#
# REQUIRE: mountcritremote named ypbind
2000-03-10 14:53:23 +03:00
# PROVIDE: mountall
$_rc_subr_loaded . /etc/rc.subr
2000-03-10 14:53:23 +03:00
name="mountall"
start_cmd="mountall_start"
stop_cmd="mountall_stop"
mountall_start()
{
echo 'Mounting all file systems...'
if [ -f /etc/zfs/zpool.cache ]; then
# Get ZFS module loaded (and thereby, zvols created).
zfs list > /dev/null 2>&1
# Initialize zvols so they can be mounted
zfs volinit
# Mount file systems noted in fstab.
mount -a
# Mount ZFS file systems.
zfs mount -a
else
# Mount file systems noted in fstab.
mount -a
fi
}
mountall_stop()
{
echo 'Unmounting all file systems...'
if [ -f /etc/zfs/zpool.cache ]; then
# Unmount ZFS file systems.
zfs unmount -a
# Unmount file systems noted in fstab.
umount -a
# Unload ZFS module, so disk devices are closed.
modunload zfs
else
# Otherwise, just deal with fstab.
umount -a
fi
}
2000-03-10 14:53:23 +03:00
load_rc_config $name
2000-03-10 14:53:23 +03:00
run_rc_command "$1"