diff options
Diffstat (limited to 'sys-fs/zfs-fuse/files/zfs-fuse.rc')
-rw-r--r-- | sys-fs/zfs-fuse/files/zfs-fuse.rc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/sys-fs/zfs-fuse/files/zfs-fuse.rc b/sys-fs/zfs-fuse/files/zfs-fuse.rc new file mode 100644 index 000000000000..415ea99fc429 --- /dev/null +++ b/sys-fs/zfs-fuse/files/zfs-fuse.rc @@ -0,0 +1,46 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-fuse/files/zfs-fuse.rc,v 1.3 2010/06/05 23:46:32 ssuominen Exp $ + +depend() { + before net + need fuse +} + +PIDFILE="/var/run/zfs/zfs-fuse.pid" +EXEFILE="/usr/sbin/zfs-fuse" + +checksystem() { + return 0 # TODO +} + +start() { + ebegin "Starting ZFS-FUSE" + checksystem || return 1 + start-stop-daemon --start --exec ${EXEFILE} \ + --user daemon --group disk -- --pidfile ${PIDFILE} + rv=$? + eend $rv + + if [[ $rv -eq 0 ]]; then + ebegin "Mounting ZFS filesystems" + zfs mount -a + eend $? + fi +} + +stop() { + ebegin "Unmounting ZFS filesystems" + sync + sleep 1 + zfs umount -f -a + eend $? + sync + + ebegin "Stopping ZFS-FUSE" + checksystem || return 2 + start-stop-daemon --stop --pidfile ${PIDFILE} \ + --exec ${EXEFILE} --retry TERM/1/TERM/2/TERM/4/TERM/8/KILL + eend $? +} |