37 lines
424 B
Bash
37 lines
424 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: zfs
|
|
# REQUIRE: mountcritlocal
|
|
# KEYWORD: nojail
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="zfs"
|
|
rcvar="zfs_enable"
|
|
start_cmd="zfs_start"
|
|
stop_cmd="zfs_stop"
|
|
required_modules="zfs"
|
|
|
|
zfs_start()
|
|
{
|
|
zfs volinit
|
|
zfs mount -a
|
|
zfs share -a
|
|
if [ ! -r /etc/zfs/exports ]; then
|
|
touch /etc/zfs/exports
|
|
fi
|
|
}
|
|
|
|
zfs_stop()
|
|
{
|
|
zfs unshare -a
|
|
zfs unmount -a
|
|
zfs volfini
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|