Skip to content

Commit

Permalink
Remount datasets on soft-reboot
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: kotauskas <[email protected]>
Closes #16845
  • Loading branch information
kotauskas authored Dec 13, 2024
1 parent 46e06fe commit 586304a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions etc/systemd/system/zfs-mount.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 586304a

Please sign in to comment.