2000-03-10 14:53:23 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2021-03-09 15:42:46 +03:00
|
|
|
# $NetBSD: mountall,v 1.15 2021/03/09 12:42:46 sborrill Exp $
|
2000-03-10 14:53:23 +03:00
|
|
|
#
|
|
|
|
|
2008-12-01 17:47:14 +03:00
|
|
|
# REQUIRE: mountcritremote named ypbind
|
2000-03-10 14:53:23 +03:00
|
|
|
# PROVIDE: mountall
|
|
|
|
|
2004-08-13 22:08:03 +04:00
|
|
|
$_rc_subr_loaded . /etc/rc.subr
|
2000-03-10 14:53:23 +03:00
|
|
|
|
|
|
|
name="mountall"
|
2009-10-06 02:39:27 +04:00
|
|
|
start_cmd="mountall_start"
|
|
|
|
stop_cmd="mountall_stop"
|
|
|
|
|
|
|
|
mountall_start()
|
|
|
|
{
|
2014-07-22 21:11:09 +04:00
|
|
|
echo 'Mounting all file systems...'
|
2020-03-01 18:22:55 +03:00
|
|
|
|
|
|
|
# Mount ZFS filesystems first because fstab
|
|
|
|
# may try and null mount paths on ZFS.
|
2020-02-23 11:53:25 +03:00
|
|
|
if checkyesno zfs; then
|
2009-10-06 02:39:27 +04:00
|
|
|
zfs mount -a
|
2021-02-16 13:02:42 +03:00
|
|
|
zfs share -a
|
2009-10-06 02:39:27 +04:00
|
|
|
fi
|
2020-03-01 18:22:55 +03:00
|
|
|
|
|
|
|
# Mount file systems noted in fstab.
|
|
|
|
mount -a
|
2009-10-06 02:39:27 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
mountall_stop()
|
|
|
|
{
|
2014-07-22 21:11:09 +04:00
|
|
|
echo 'Unmounting all file systems...'
|
2020-03-01 18:22:55 +03:00
|
|
|
# Unmount file systems noted in fstab.
|
|
|
|
umount -a
|
|
|
|
|
|
|
|
# Unmount ZFS file systems.
|
2020-02-23 11:53:25 +03:00
|
|
|
if checkyesno zfs; then
|
2021-02-16 13:02:42 +03:00
|
|
|
zfs unshare -a
|
2009-10-06 02:39:27 +04:00
|
|
|
zfs unmount -a
|
|
|
|
fi
|
|
|
|
}
|
2000-03-10 14:53:23 +03:00
|
|
|
|
2000-05-13 12:45:06 +04:00
|
|
|
load_rc_config $name
|
2021-03-09 15:42:46 +03:00
|
|
|
load_rc_config_var zfs zfs
|
2000-03-10 14:53:23 +03:00
|
|
|
run_rc_command "$1"
|