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 <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2003
This commit is contained in:
Turbo Fredriksson 2013-12-24 16:18:00 +00:00 committed by Brian Behlendorf
parent fb8e608d9d
commit 8c091798f2
1 changed files with 11 additions and 0 deletions

View File

@ -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"
}