bees: Try all findmnt modes in service wrapper
As reported by @Evils-Devils in Zygo/bees#123, the bees service wrapper can fail on account of `findmnt` not being able to identify a mounted filesystem using the default (kernel-introspection) mechanism. Fall back to mtab and fstab-based inspection in turn should this fail.
This commit is contained in:
parent
459bad4be4
commit
cb657d4ad1
1 changed files with 5 additions and 1 deletions
|
@ -140,7 +140,11 @@ _setup() {
|
|||
|
||||
[[ $bees_uuid ]] || {
|
||||
# if bees_uuid is not in our .conf file, look it up with findmnt
|
||||
read -r bees_uuid fstype < <(findmnt -n -o uuid,fstype "$bees_fsSpec") && [[ $fstype ]] || exit
|
||||
for findmnt_mode in --kernel --mtab --fstab; do
|
||||
read -r bees_uuid fstype < <(findmnt "$findmnt_mode" -n -o uuid,fstype "$bees_fsSpec") ||:
|
||||
[[ $bees_uuid && $fstype ]] && break
|
||||
done
|
||||
[[ $bees_uuid ]] || die "Unable to identify a device matching $bees_fsSpec with findmnt"
|
||||
[[ $fstype = btrfs ]] || die "Device type is $fstype, not btrfs"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue