summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorTurbo Fredriksson <[email protected]>2013-12-24 16:18:00 +0000
committerBrian Behlendorf <[email protected]>2014-01-07 09:48:04 -0800
commit8c091798f26e7c1e6fd105e90065ebe12d97dfc2 (patch)
tree830db966ea7de84b216c526978df1615059964be /etc
parentfb8e608d9dacf2f6703da8c853f6086e4dd79824 (diff)
Add UNSHARING of filesystems and EXPORTING pools
As a 'stop' action ensure the filesystem is unshared before it is unmounted, just in case. Additionally, export the pool so it may be cleanly imported by a different host. Signed-off-by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2003
Diffstat (limited to 'etc')
-rw-r--r--etc/init.d/zfs.lsb.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/etc/init.d/zfs.lsb.in b/etc/init.d/zfs.lsb.in
index e970e5717..f400fca32 100644
--- a/etc/init.d/zfs.lsb.in
+++ b/etc/init.d/zfs.lsb.in
@@ -106,10 +106,21 @@ stop()
{
[ ! -f "$LOCKFILE" ] && return 3
+ log_begin_msg "Unsharing ZFS filesystems"
+ "$ZFS" unshare -a
+ log_end_msg $?
+
log_begin_msg "Unmounting ZFS filesystems"
"$ZFS" umount -a
log_end_msg $?
+ log_begin_msg "Exporting ZFS pools"
+ "$ZPOOL" list -H -o name | \
+ while read pool; do
+ "$ZPOOL" export $pool
+ done
+ log_end_msg $?
+
rm -f "$LOCKFILE"
}