zfs revision 301612
137Srgrimes#!/bin/sh 237Srgrimes# 337Srgrimes# $FreeBSD: stable/10/etc/rc.d/zfs 301612 2016-06-08 13:32:00Z ngie $ 437Srgrimes# 537Srgrimes 637Srgrimes# PROVIDE: zfs 737Srgrimes# REQUIRE: mountcritlocal 837Srgrimes# BEFORE: FILESYSTEMS var 9476Srgrimes 1037Srgrimes. /etc/rc.subr 1137Srgrimes 1237Srgrimesname="zfs" 1337Srgrimesrcvar="zfs_enable" 1437Srgrimesstart_cmd="zfs_start" 1537Srgrimesstop_cmd="zfs_stop" 1637Srgrimesrequired_modules="zfs" 1737Srgrimes 1837Srgrimeszfs_start_jail() 1937Srgrimes{ 2037Srgrimes if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then 2137Srgrimes zfs mount -a 2237Srgrimes fi 2337Srgrimes} 2437Srgrimes 2537Srgrimeszfs_start_main() 2637Srgrimes{ 2737Srgrimes zfs mount -va 2837Srgrimes zfs share -a 2937Srgrimes if [ ! -r /etc/zfs/exports ]; then 301141Sache touch /etc/zfs/exports 311141Sache fi 321141Sache} 331141Sache 341141Sachezfs_start() 357708Srgrimes{ 3611137Sjoerg if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then 3711137Sjoerg zfs_start_jail 381141Sache else 3911137Sjoerg zfs_start_main 4011137Sjoerg fi 4111137Sjoerg} 4211137Sjoerg 4311137Sjoergzfs_stop_jail() 4411137Sjoerg{ 4511137Sjoerg if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then 4611137Sjoerg zfs unmount -a 4711137Sjoerg fi 481141Sache} 491141Sache 501141Sachezfs_stop_main() 511141Sache{ 521141Sache zfs unshare -a 531141Sache zfs unmount -a 541141Sache} 551141Sache 561141Sachezfs_stop() 571141Sache{ 581141Sache if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then 591141Sache zfs_stop_jail 601141Sache else 611182Srgrimes zfs_stop_main 621144Sache fi 631141Sache} 641141Sache 651141Sacheload_rc_config $name 661141Sacherun_rc_command "$1" 671182Srgrimes