From 44287ffa0d5d6f23b4dc082b67ea5b7c5a465d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Mon, 19 Apr 2021 19:52:44 +0200 Subject: [PATCH] etc/systemd/zfs-mount-generator: don't fail if no cached pools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If $FSLIST exists but is empty, the generator fails with sort: cannot read: '/etc/zfs/zfs-list.cache/*': No such file or directory Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #11915 --- etc/systemd/system-generators/zfs-mount-generator.in | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/systemd/system-generators/zfs-mount-generator.in b/etc/systemd/system-generators/zfs-mount-generator.in index 28439f424a..c276fbbce5 100755 --- a/etc/systemd/system-generators/zfs-mount-generator.in +++ b/etc/systemd/system-generators/zfs-mount-generator.in @@ -28,6 +28,7 @@ set -e FSLIST="@sysconfdir@/zfs/zfs-list.cache" [ -d "${FSLIST}" ] || exit 0 +[ "$(echo "${FSLIST}"/*)" = "${FSLIST}/*" ] && exit 0 do_fail() { printf 'zfs-mount-generator: %s\n' "$*" > /dev/kmsg