1 |
ryao 13/05/29 00:39:52 |
2 |
|
3 |
Added: zfs-0.6.1-gentoo-openrc-dependencies.patch |
4 |
Log: |
5 |
Introduce bash-completion USE flag, fix test-suite and dracut USE flags, correct description for rootfs USE flag and improve zfs OpenRC script for systems with a ZFS rootfs. |
6 |
|
7 |
(Portage version: 2.2.0_alpha177/cvs/Linux x86_64, signed Manifest commit with key 0xBEE84C64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 sys-fs/zfs/files/zfs-0.6.1-gentoo-openrc-dependencies.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-0.6.1-gentoo-openrc-dependencies.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-0.6.1-gentoo-openrc-dependencies.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: zfs-0.6.1-gentoo-openrc-dependencies.patch |
16 |
=================================================================== |
17 |
commit 75c2fb953c99bba008f1ef72ee71136002749f51 |
18 |
Author: Richard Yao <ryao@×××××××××××××.edu> |
19 |
Date: Tue May 28 20:08:15 2013 -0400 |
20 |
|
21 |
Improve OpenRC init script |
22 |
|
23 |
The current zfs OpenRC script's dependencies cause OpenRC to attempt to |
24 |
unmount ZFS filesystems at shutdown while things were still using them, |
25 |
which would fail. This is a cosmetic issue, but it should still be |
26 |
addressed. It probably does not affect systems where the rootfs is a |
27 |
legacy filesystem, but any system with the rootfs on ZFS needs to run |
28 |
the ZFS init script after the system is ready to shutdown filesystems. |
29 |
|
30 |
OpenRC's shutdown process occurs in the reverse order of the startup |
31 |
process. Therefore running the ZFS shutdown procedure after filesystems |
32 |
are ready to be unmounted requires running the startup procedure before |
33 |
fstab. This patch changes the dependencies of the script to expliclty |
34 |
run before fstab at boot when the rootfs is ZFS and to run after fstab |
35 |
at boot whenever the rootfs is not ZFS. This should cover most use |
36 |
cases. |
37 |
|
38 |
The only cases not covered well by this are systems with legacy |
39 |
root filesystems where people want to configure fstab to mount a non-ZFS |
40 |
filesystem off a zvol and possibly also systems whose pools are stored |
41 |
on network block devices. The former requires that the ZFS script run |
42 |
before fstab, which could cause ZFS datasets to mount too early and |
43 |
appear under the fstab mount points. The latter requires that the ZFS |
44 |
script run after networking starts, which precludes the ability to store |
45 |
any system information on ZFS. An additional OpenRC script could be |
46 |
written to handle non-root pools on network block devices, but that will |
47 |
depend on user demand and developer time. |
48 |
|
49 |
Signed-off-by: Richard Yao <ryao@×××××××××××××.edu> |
50 |
|
51 |
diff --git a/etc/init.d/zfs.gentoo.in b/etc/init.d/zfs.gentoo.in |
52 |
index 5b8671e..0034e02 100644 |
53 |
--- a/etc/init.d/zfs.gentoo.in |
54 |
+++ b/etc/init.d/zfs.gentoo.in |
55 |
@@ -10,9 +10,16 @@ fi |
56 |
|
57 |
depend() |
58 |
{ |
59 |
+ # Try to allow people to mix and match fstab with ZFS in a way that makes sense. |
60 |
+ if [ "$(mountinfo -s /)" = 'zfs' ] |
61 |
+ then |
62 |
+ before localmount |
63 |
+ else |
64 |
+ after localmount |
65 |
+ fi |
66 |
+ |
67 |
# bootmisc will log to /var which may be a different zfs than root. |
68 |
- before net bootmisc |
69 |
- after udev localmount |
70 |
+ before bootmisc logger |
71 |
keyword -lxc -openvz -prefix -vserver |
72 |
} |