Skip to content

Commit

Permalink
Add UNSHARING of filesystems and EXPORTING pools
Browse files Browse the repository at this point in the history
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 openzfs#2003
  • Loading branch information
FransUrbo authored and behlendorf committed Jan 7, 2014
1 parent fb8e608 commit 8c09179
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions etc/init.d/zfs.lsb.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down

0 comments on commit 8c09179

Please sign in to comment.