From 586304ac444f888aae584fdbea5fbeac2b76cb32 Mon Sep 17 00:00:00 2001 From: kotauskas Date: Sat, 14 Dec 2024 00:50:50 +0300 Subject: [PATCH] Remount datasets on soft-reboot The one-shot zfs-mount.service is incorrectly deemed active by Systemd after a systemctl soft-reboot. As such, soft-rebooting prevents zfs mount -a from being ran automatically. This commit makes it so that zfs-mount.service is marked as being undone by the time umount.target is reached, so that zfs.target then pulls it in again and gets it restarted after a soft reboot. Reviewed by: Brian Behlendorf Signed-off-by: kotauskas Closes #16845 --- etc/systemd/system/zfs-mount.service.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etc/systemd/system/zfs-mount.service.in b/etc/systemd/system/zfs-mount.service.in index 66d894923..41c02c823 100644 --- a/etc/systemd/system/zfs-mount.service.in +++ b/etc/systemd/system/zfs-mount.service.in @@ -8,6 +8,13 @@ After=systemd-remount-fs.service Before=local-fs.target ConditionPathIsDirectory=/sys/module/zfs +# This merely tells the service manager +# that unmounting everything undoes the +# effect of this service. No extra logic +# is ran as a result of these settings. +Conflicts=umount.target +Before=umount.target + [Service] Type=oneshot RemainAfterExit=yes -- 2.11.4.GIT