Skip to content

Commit

Permalink
using device mapper name for systemd unit instead
Browse files Browse the repository at this point in the history
  • Loading branch information
luiz committed May 14, 2022
1 parent a520628 commit fbdfd9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
16 changes: 7 additions & 9 deletions scripts/beesd.in
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ readonly bees_bin=$(realpath @LIBEXEC_PREFIX@/bees)

command -v "$bees_bin" &> /dev/null || ERRO "Missing 'bees' agent"

uuid_valid(){
if uuidparse -n -o VARIANT $1 | grep -i -q invalid; then
false
fi
}

help(){
echo "Usage: beesd [options] <btrfs_uuid>"
echo "- - -"
Expand Down Expand Up @@ -62,9 +56,13 @@ for arg in "${ARGUMENTS[@]}"; do
done

for arg in "${NOT_SUPPORTED_ARGS[@]}"; do
if uuid_valid $arg; then
[ ! -z "$UUID" ] && help
UUID=$arg
if [ ! -z "$(blkid --uuid $arg -o value | head -1)" ]; then
UUID="$arg"
INFO "Using UUID $arg"
fi
if [ ! -z "$(blkid /dev/mapper/$arg -o value | head -1)" ]; then
UUID="$(blkid /dev/mapper/$arg -o value | head -1)"
INFO "Found $UUID for $arg"
fi
done

Expand Down
5 changes: 3 additions & 2 deletions scripts/[email protected]
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[Unit]
Description=Bees (%i)
Documentation=https://github.com/Zygo/bees
After=sysinit.target
#After=sysinit.target
After=local-fs.target

[Service]
Type=simple
Expand Down Expand Up @@ -56,4 +57,4 @@ AmbientCapabilities=CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_SYS_ADMI
NoNewPrivileges=true

[Install]
WantedBy=basic.target
WantedBy=multi-user.target

0 comments on commit fbdfd9b

Please sign in to comment.