10 [ -f /etc
/conf.d
/zfs-fuse
] && .
/etc
/conf.d
/zfs-fuse
14 stat_busy
"Starting ZFS daemon"
15 PID
=`pidof -o %PPID /usr/sbin/zfs-fuse`
16 if [ -z "$PID" ]; then
17 if [ -e /var
/run
/zfs-fuse.pid
]; then
18 rm /var
/run
/zfs-fuse.pid
19 /usr
/sbin
/zfs-fuse
-p /var
/run
/zfs-fuse.pid
21 # wait for zfs-fuse daemon to come up
24 if [ ${#ZFS_IMPORT} -ne 0 ]; then
25 for dataset
in ${ZFS_IMPORT[@]}; do
26 /usr
/sbin
/zpool import
"$dataset"
29 if [ ${#ZFS_MOUNT} -ne 0 ]; then
30 for dataset
in ${ZFS_MOUNT[@]}; do
31 /usr
/sbin
/zfs mount
"$dataset" 2>/dev
/null
38 /usr
/sbin
/zfs-fuse
-p /var
/run
/zfs-fuse.pid
40 # wait for zfs-fuse daemon to come up
43 if [ ${#ZFS_IMPORT} -ne 0 ]; then
44 for dataset
in ${ZFS_IMPORT[@]}; do
45 /usr
/sbin
/zpool import
"$dataset"
48 if [ ${#ZFS_MOUNT} -ne 0 ]; then
49 for dataset
in ${ZFS_MOUNT[@]}; do
50 /usr
/sbin
/zfs mount
"$dataset" 2>/dev
/null
58 stat_append
"- ZFS daemon seems to be running!"
63 stat_busy
"Stopping ZFS daemon"
65 /usr
/sbin
/zfs unmount
-a
66 for pool
in $
(/usr
/sbin
/zpool list
-o name |
/bin
/grep -v NAME
); do
67 /usr
/sbin
/zpool
export "$pool" 2>/dev
/null
70 PID
=`pidof -o %PPID /usr/sbin/zfs-fuse`
75 if [ -e /var
/run
/zfs-fuse.pid
]; then
76 rm /var
/run
/zfs-fuse.pid
90 echo "usage: $0 {start|stop|restart}"