From 59ca6e2ad0b40a67d83cddae8e33d95e8957ad06 Mon Sep 17 00:00:00 2001 From: Vince van Oosten Date: Sun, 23 Oct 2022 11:11:18 +0200 Subject: [PATCH] include overrides for zfs-import.target Reviewed-by: Brian Behlendorf Signed-off-by: Vince van Oosten Closes #14075 Closes #14076 --- contrib/dracut/90zfs/module-setup.sh.in | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in index b16529de9..6be718587 100755 --- a/contrib/dracut/90zfs/module-setup.sh.in +++ b/contrib/dracut/90zfs/module-setup.sh.in @@ -81,15 +81,24 @@ install() { inst_simple "${moddir}/zfs-env-bootfs.service" "${systemdsystemunitdir}/zfs-env-bootfs.service" systemctl -q --root "${initdir}" add-wants zfs-import.target zfs-env-bootfs.service + # Add user-provided unit overrides: + # - /etc/systemd/system/${_service} + # - /etc/systemd/system/${_service}.d/overrides.conf + # -H ensures they are marked host-only + # -o ensures there is no error upon absence of these files + inst_multiple -o -H \ + "${systemdsystemconfdir}/zfs-import.target" \ + "${systemdsystemconfdir}/zfs-import.target.d/"*.conf + for _service in \ "zfs-import-scan.service" \ "zfs-import-cache.service"; do inst_simple "${systemdsystemunitdir}/${_service}" systemctl -q --root "${initdir}" add-wants zfs-import.target "${_service}" - # Add user-provided unit overrides - # - /etc/systemd/system/zfs-import-{scan,cache}.service - # - /etc/systemd/system/zfs-import-{scan,cache}.service.d/overrides.conf + # Add user-provided unit overrides: + # - /etc/systemd/system/${_service} + # - /etc/systemd/system/${_service}.d/overrides.conf # -H ensures they are marked host-only # -o ensures there is no error upon absence of these files inst_multiple -o -H \