2 # /etc/rc.d/zfs-fuse for archlinux
3 # worked over by khampf@users.sourceforge.net 2011
12 [ -f /etc
/conf.d
/zfs-fuse
] && .
/etc
/conf.d
/zfs-fuse
16 stat_busy
"Starting ZFS daemon"
17 PID
=`pidof -o %PPID /usr/sbin/zfs-fuse`
18 if [ -z "$PID" ]; then
19 if [ -e /var
/run
/zfs-fuse.pid
]; then
20 rm /var
/run
/zfs-fuse.pid
23 # currently SEGFAULTS using --pidfile
24 /usr
/sbin
/zfs-fuse
# --pidfile /var/run/zfs-fuse.pid
25 pidof
-o %PPID
/usr
/sbin
/zfs-fuse
> '/var/run/zfs-fuse.pid'
27 # wait for zfs-fuse daemon to come up
30 if [ ${#ZFS_IMPORT} -ne 0 ]; then
31 for dataset
in ${ZFS_IMPORT[@]}; do
32 /usr
/sbin
/zpool import
"$dataset"
35 if [ ${#ZFS_MOUNT} -ne 0 ]; then
36 for dataset
in ${ZFS_MOUNT[@]}; do
37 /usr
/sbin
/zfs mount
"$dataset" 2>/dev
/null
44 stat_append
"- ZFS daemon seems to be running!"
49 stat_busy
"Stopping ZFS daemon"
51 /usr
/sbin
/zfs unmount
-a
52 for pool
in $
(/usr
/sbin
/zpool list
-o name |
/bin
/grep -v NAME
); do
53 /usr
/sbin
/zpool
export "$pool" 2>/dev
/null
56 PID
=`pidof -o %PPID /usr/sbin/zfs-fuse`
61 if [ -e /var
/run
/zfs-fuse.pid
]; then
62 rm /var
/run
/zfs-fuse.pid
68 PID
=`pidof -o %PPID /usr/sbin/zfs-fuse`
74 echo "usage: $0 {start|stop|restart}"