[BACK]Return to mountall CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

File: [cvs.NetBSD.org] / src / etc / rc.d / mountall (download)

Revision 1.9, Tue Jul 22 17:11:09 2014 UTC (9 years, 8 months ago) by wiz
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-base, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: pgoyette-compat
Changes since 1.8: +3 -3 lines

'file system' for consistency with documentation (instead of 'filesystem').

#!/bin/sh
#
# $NetBSD: mountall,v 1.9 2014/07/22 17:11:09 wiz 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...'
	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
}

load_rc_config $name
run_rc_command "$1"