mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-28 17:39:23 +03:00
Properly use the Dracut cleanup hook to order pool shutdown
When Dracut starts up, it needs to determine whether a pool will remain "hanging open" before the system shuts off. In such a case, then the code to clean up the pool (using the previous export -F work) must be invoked. Since Dracut has had a recent change that makes mount-zfs.sh simply not run when the root dataset is already mounted, we must use the cleanup hook to order Dracut to do shutdown cleanup. Important note: this code will not accomplish its stated goal until this bug is fixed: https://bugzilla.redhat.com/show_bug.cgi?id=1385432 That bug impacts more than just ZFS. It impacts LUKS, dmraid, and unmount during poweroff. It is a Fedora-wide bug. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Manuel Amador (Rudd-O) <rudd-o@rudd-o.com> Closes #5287
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
if zpool list 2>&1 | grep -q 'no pools available' ; then
|
||||
info "ZFS: No active pools, no need to export anything."
|
||||
else
|
||||
info "ZFS: There is an active pool, will export it."
|
||||
need_shutdown
|
||||
fi
|
||||
Reference in New Issue
Block a user