]> CyberLeo.Net >> Repos - CDN/portage-cdn.git/blob - sys-fs/zfs-fuse/files/zfs-fuse
sys-fs/zfs-fuse: revbump
[CDN/portage-cdn.git] / sys-fs / zfs-fuse / files / zfs-fuse
1 #!/sbin/runscript
2 # Copyright 1999-2010 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs-fuse/files/zfs-fuse,v 1.1 2010/06/22 20:13:43 ssuominen Exp $
5
6 depend() {
7         before net
8         need fuse
9 }
10
11 PIDFILE="/var/run/zfs/zfs-fuse.pid"
12 EXEFILE="/usr/sbin/zfs-fuse"
13
14 checksystem() {
15         return 0 # TODO
16 }
17
18 start() {
19         ebegin "Starting ZFS-FUSE"
20         checksystem || return 1
21         start-stop-daemon --start --exec ${EXEFILE} \
22                 --user root --group disk -- --pidfile ${PIDFILE}
23         rv=$?
24         eend $rv
25
26         if [[ $rv -eq 0 ]]; then
27                 ebegin "Mounting ZFS filesystems"
28                 zfs mount -a
29                 eend $?
30         fi
31 }
32
33 stop() {
34         ebegin "Unmounting ZFS filesystems"
35         sync
36         sleep 1
37         zfs umount -f -a
38         eend $?
39         sync
40
41         ebegin "Stopping ZFS-FUSE"
42         checksystem || return 2
43         start-stop-daemon --stop --pidfile ${PIDFILE} \
44                 --exec ${EXEFILE} --retry TERM/1/TERM/2/TERM/4/TERM/8/KILL
45         eend $?
46 }