Gentoo Archives: gentoo-commits

From: "Javier Villavicencio (the_paya)" <the_paya@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-freebsd/freebsd-cddl/files: zvol.initd
Date: Sun, 04 Apr 2010 21:04:22
Message-Id: E1NyWzT-0004s8-9W@stork.gentoo.org
1 the_paya 10/04/04 21:04:19
2
3 Added: zvol.initd
4 Log:
5 New init.d script to start zfs volumes and swap.
6 (Portage version: 2.2_rc67/cvs/FreeBSD i386)
7
8 Revision Changes Path
9 1.1 sys-freebsd/freebsd-cddl/files/zvol.initd
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-cddl/files/zvol.initd?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-cddl/files/zvol.initd?rev=1.1&content-type=text/plain
13
14 Index: zvol.initd
15 ===================================================================
16 #!/sbin/runscript
17 # Copyright 1999-2010 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-cddl/files/zvol.initd,v 1.1 2010/04/04 21:04:19 the_paya Exp $
20
21 depend() {
22 need hostid
23 before fsck
24 }
25
26 start() {
27 einfo "Starting zfs volumes..."
28 zfs volinit
29 eend $?
30 # Enable swap on ZVOLs that have org.freebsd:swap=on.
31 zfs list -H -o org.freebsd:swap,name -t volume | \
32 while read state name; do
33 case "${state}" in
34 [oO][nN])
35 einfo "Enabling swap on zvol ${name}"
36 swapon /dev/zvol/${name}
37 eend $?
38 ;;
39 esac
40 done
41 }
42
43 stop() {
44 # Disable what we had enabled before.
45 zfs list -H -o org.freebsd:swap,name -t volume | \
46 while read state name; do
47 case "${state}" in
48 [oO][nN])
49 einfo "Disabling swap on zvol ${name}"
50 swapoff /dev/zvol/${name}
51 eend $?
52 ;;
53 esac
54 done
55 einfo "Stopping zfs volumes..."
56 zfs volfini
57 eend $?
58 }
59
60 restart() {
61
62 }