fix: export zpools on zfs shutdown

Fixes cases where later tasks fail because the disks are still in use
(e.g. closing encrypted volumes).

Signed-off-by: Galen Abell <galen@galenabell.com>
Signed-off-by: Noel Georgi <git@frezbo.dev>
(cherry picked from commit 5aeaf4e774be4b35feb8c522bfce01014e503591)
This commit is contained in:
Galen Abell 2026-03-29 16:42:22 +02:00 committed by Andrey Smirnov
parent 72acf39e45
commit f89b23210d
No known key found for this signature in database
GPG Key ID: 322C6F63F594CE7C

View File

@ -31,4 +31,11 @@ func main() {
if err := cmd.Run(); err != nil {
log.Fatalf("zfs-service: zfs unmount error: %v\n", err)
}
cmd = exec.Command("/usr/local/sbin/zpool", "export", "-a")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Fatalf("zfs-service: zpool export error: %v\n", err)
}
}