From 741ee6e5ece6809917feed70c0cea1d8f0a2734c Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Wed, 19 Jun 2019 07:48:41 +0200 Subject: [PATCH] systemd: fix shutdown ordering to be after FS umount Currently on shutdown blk_availability will start almost as early as possible and invoke blkdeactivate. This can make devices and the filesystems on them unavailable that will still be needed by other parts of the shutdown. Usually such services needing the local filesystem will have declared After=local-fs.target And expect to be shut down before things are unmounted. But blkdeactivate might unmount things before all of that. To guarantee no devices / filesystems going away too early let us declare for blk_availability: Before=local-fs.target On shutdown that ensures that blkdeactivate will only be ordered after local-fs.target which seems what users would expect. Fixes: #18 Signed-off-by: Christian Ehrhardt --- scripts/blk_availability_systemd_red_hat.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/blk_availability_systemd_red_hat.service.in b/scripts/blk_availability_systemd_red_hat.service.in index 82d3b82d01..44555b91f7 100644 --- a/scripts/blk_availability_systemd_red_hat.service.in +++ b/scripts/blk_availability_systemd_red_hat.service.in @@ -1,6 +1,6 @@ [Unit] Description=Availability of block devices -Before=shutdown.target +Before=shutdown.target local-fs.target After=lvm2-activation.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service rbdmap.service DefaultDependencies=no Conflicts=shutdown.target