public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-fs/zfs/files: zfs-0.6.1-gentoo-openrc-dependencies.patch
@ 2013-05-29  0:39 Richard Yao (ryao)
  0 siblings, 0 replies; only message in thread
From: Richard Yao (ryao) @ 2013-05-29  0:39 UTC (permalink / raw
  To: gentoo-commits

ryao        13/05/29 00:39:52

  Added:                zfs-0.6.1-gentoo-openrc-dependencies.patch
  Log:
  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.
  
  (Portage version: 2.2.0_alpha177/cvs/Linux x86_64, signed Manifest commit with key 0xBEE84C64)

Revision  Changes    Path
1.1                  sys-fs/zfs/files/zfs-0.6.1-gentoo-openrc-dependencies.patch

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
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

Index: zfs-0.6.1-gentoo-openrc-dependencies.patch
===================================================================
commit 75c2fb953c99bba008f1ef72ee71136002749f51
Author: Richard Yao <ryao@cs.stonybrook.edu>
Date:   Tue May 28 20:08:15 2013 -0400

    Improve OpenRC init script
    
    The current zfs OpenRC script's dependencies cause OpenRC to attempt to
    unmount ZFS filesystems at shutdown while things were still using them,
    which would fail. This is a cosmetic issue, but it should still be
    addressed. It probably does not affect systems where the rootfs is a
    legacy filesystem, but any system with the rootfs on ZFS needs to run
    the ZFS init script after the system is ready to shutdown filesystems.
    
    OpenRC's shutdown process occurs in the reverse order of the startup
    process. Therefore running the ZFS shutdown procedure after filesystems
    are ready to be unmounted requires running the startup procedure before
    fstab. This patch changes the dependencies of the script to expliclty
    run before fstab at boot when the rootfs is ZFS and to run after fstab
    at boot whenever the rootfs is not ZFS. This should cover most use
    cases.
    
    The only cases not covered well by this are systems with legacy
    root filesystems where people want to configure fstab to mount a non-ZFS
    filesystem off a zvol and possibly also systems whose pools are stored
    on network block devices. The former requires that the ZFS script run
    before fstab, which could cause ZFS datasets to mount too early and
    appear under the fstab mount points. The latter requires that the ZFS
    script run after networking starts, which precludes the ability to store
    any system information on ZFS. An additional OpenRC script could be
    written to handle non-root pools on network block devices, but that will
    depend on user demand and developer time.
    
    Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>

diff --git a/etc/init.d/zfs.gentoo.in b/etc/init.d/zfs.gentoo.in
index 5b8671e..0034e02 100644
--- a/etc/init.d/zfs.gentoo.in
+++ b/etc/init.d/zfs.gentoo.in
@@ -10,9 +10,16 @@ fi
 
 depend()
 {
+	# Try to allow people to mix and match fstab with ZFS in a way that makes sense.
+	if [ "$(mountinfo -s /)" = 'zfs' ]
+	then
+		before localmount
+	else
+		after localmount
+	fi
+
 	# bootmisc will log to /var which may be a different zfs than root.
-	before net bootmisc
-	after udev localmount
+	before bootmisc logger
 	keyword -lxc -openvz -prefix -vserver
 }
 





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-05-29  0:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-29  0:39 [gentoo-commits] gentoo-x86 commit in sys-fs/zfs/files: zfs-0.6.1-gentoo-openrc-dependencies.patch Richard Yao (ryao)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox