mountall revision 1.7
11.1Slukem#!/bin/sh
21.1Slukem#
31.7Shaad# $NetBSD: mountall,v 1.7 2009/10/05 22:39:27 haad Exp $
41.1Slukem#
51.1Slukem
61.6Stsutsui# REQUIRE: mountcritremote named ypbind
71.1Slukem# PROVIDE: mountall
81.1Slukem
91.4Smycroft$_rc_subr_loaded . /etc/rc.subr
101.1Slukem
111.1Slukemname="mountall"
121.7Shaadstart_cmd="mountall_start"
131.7Shaadstop_cmd="mountall_stop"
141.7Shaad
151.7Shaadmountall_start()
161.7Shaad{
171.7Shaad	echo 'Mounting all filesystems...'
181.7Shaad	if [ -f /etc/zfs/zpool.cache ]; then
191.7Shaad		# Get ZFS module loaded (and thereby, zvols created).
201.7Shaad		zfs list > /dev/null 2>&1
211.7Shaad		# Mount file systems noted in fstab.
221.7Shaad		mount -a
231.7Shaad		# Mount ZFS file systems.
241.7Shaad		zfs mount -a
251.7Shaad	else
261.7Shaad		# Mount file systems noted in fstab.
271.7Shaad		mount -a
281.7Shaad	fi
291.7Shaad}
301.7Shaad
311.7Shaadmountall_stop()
321.7Shaad{
331.7Shaad	echo 'Unmounting all filesystems...'
341.7Shaad	if [ -f /etc/zfs/zpool.cache ]; then
351.7Shaad		# Unmount ZFS file systems.
361.7Shaad		zfs unmount -a
371.7Shaad		# Unmount file systems noted in fstab.
381.7Shaad		umount -a
391.7Shaad		# Unload ZFS module, so disk devices are closed.
401.7Shaad		modunload zfs
411.7Shaad	else
421.7Shaad		# Otherwise, just deal with fstab.
431.7Shaad		umount -a
441.7Shaad	fi
451.7Shaad}
461.1Slukem
471.3Slukemload_rc_config $name
481.1Slukemrun_rc_command "$1"
49