summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yao <ryao@gentoo.org>2013-07-14 11:52:57 +0000
committerRichard Yao <ryao@gentoo.org>2013-07-14 11:52:57 +0000
commit5b5161670899618011033f4ed3a9e118cb273886 (patch)
treeaa7f6d0899162879c15da37a7e8bfff98b54919f /sys-fs/zfs/files/zfs-init.sh.in
parentLinux 3.10 support; asynchronous zvol initialization; miscellaneous fixes for... (diff)
downloadhistorical-5b5161670899618011033f4ed3a9e118cb273886.tar.gz
historical-5b5161670899618011033f4ed3a9e118cb273886.tar.bz2
historical-5b5161670899618011033f4ed3a9e118cb273886.zip
Systemd support (bug #475872); Add python dependency to 9999 ebuild (bug #473788); Asynchronous zvol initialization; GCC 4.8 Compatibility Fix; Miscellaneous zdb fixes
Package-Manager: portage-2.2.0_alpha187/cvs/Linux x86_64 Manifest-Sign-Key: 0xBEE84C64
Diffstat (limited to 'sys-fs/zfs/files/zfs-init.sh.in')
-rw-r--r--sys-fs/zfs/files/zfs-init.sh.in29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys-fs/zfs/files/zfs-init.sh.in b/sys-fs/zfs/files/zfs-init.sh.in
new file mode 100644
index 000000000000..ed84585cd5f6
--- /dev/null
+++ b/sys-fs/zfs/files/zfs-init.sh.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+ZFS="@sbindir@/zfs"
+ZPOOL="@sbindir@/zpool"
+ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
+
+if [ -f "${ZPOOL_CACHE}" ]; then
+ "${ZPOOL}" import -c "${ZPOOL_CACHE}" -aN 2>/dev/null
+ if [ "${?}" != "0" ]; then
+ echo "Failed to import not-yet imported pools." >&2
+ fi
+fi
+
+echo "Mounting ZFS filesystems"
+"${ZFS}" mount -a
+if [ "${?}" != "0" ]; then
+ echo "Failed to mount ZFS filesystems." >&2
+ exit 1
+fi
+
+echo "Exporting ZFS filesystems"
+"${ZFS}" share -a
+if [ "${?}" != "0" ]; then
+ echo "Failed to export ZFS filesystems." >&2
+ exit 1
+fi
+
+exit 0
+