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 <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11915
This commit is contained in:
наб 2021-04-19 19:52:44 +02:00 committed by GitHub
parent dc3a56d38b
commit 44287ffa0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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