aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-04-19 19:52:44 +0200
committerBrian Behlendorf <[email protected]>2021-04-19 15:22:58 -0700
commit478b8ec8f218f2271b8b9c5e88022b636eb72073 (patch)
tree15d667f8af27cca0df2ecd1e034d7c37a8bb9c40 /etc
parent219acd907bf041b7c42b3c8874e22c5b86bafcb2 (diff)
etc/systemd/zfs-mount-generator: don't fail if no cached pools
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 <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11915
Diffstat (limited to 'etc')
-rwxr-xr-xetc/systemd/system-generators/zfs-mount-generator.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/etc/systemd/system-generators/zfs-mount-generator.in b/etc/systemd/system-generators/zfs-mount-generator.in
index 28439f424..c276fbbce 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