#!/usr/bin/openrc-run

description="Mounts filesystems listed in /etc/fstab."

depend()
{
	need mdraid
	use modules mtab fsck mdadm
	after modules
	after fsck
}

start()
{
	ebegin "Starting \"${SVCNAME}\""
	mount -a
	eend $? "Some local filesystem failed to mount"
	return 0
}

stop()
{
	# Do nothing: ZFS manages all related stuff
	ebegin "Stopping \"${SVCNAME}\""
	(cat /etc/mtab | grep ' /boot ' > /dev/null 2>&1) && \
		mount /boot -o ro -o remount
	eend $?
	return 0
}
