bees icon indicating copy to clipboard operation
bees copied to clipboard

realpath: //usr/lib/bees/bees: No such file or directory

Open ppetr opened this issue 1 month ago • 2 comments

This looks similar to #324, but perhaps with a different cause.

I used a custom PREFIX for building and installing bees:

PREFIX=/usr/local/stow/bees make -j$(nproc)
sudo PREFIX=/usr/local/stow/bees make install

But when trying to run the systemd service, it failed with

Nov 04 17:06:17 myhost beesd[2187482]: realpath: //usr/lib/bees/bees: No such file or directory
Nov 04 17:06:17 myhost beesd[2187477]: ERROR: Missing 'bees' agent

There was another minor error that /lib/systemd/system/[email protected] didn't have the proper prefix in ExecStart (but that was easy to fix). So I guess the problem might be caused by some other place not respecting the PREFIX variable.

ppetr avatar Nov 04 '25 16:11 ppetr

This should fix this (I can send a PR later when I have more time):

diff --git a/scripts/beesd.in b/scripts/beesd.in
index b31d4c1..4e97aaf 100755
--- a/scripts/beesd.in
+++ b/scripts/beesd.in
@@ -23,7 +23,7 @@ readonly AL128K="$((128*1024))"
 readonly AL16M="$((16*1024*1024))"
 readonly CONFIG_DIR=@ETC_PREFIX@/bees/

-readonly bees_bin=$(realpath @DESTDIR@/@LIBEXEC_PREFIX@/bees)
+readonly bees_bin=$(realpath @DESTDIR@@LIBEXEC_PREFIX@/bees)

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

diff --git a/scripts/[email protected] b/scripts/[email protected]
index 3a9f025..97a5735 100644
--- a/scripts/[email protected]
+++ b/scripts/[email protected]
@@ -5,7 +5,7 @@ After=sysinit.target

 [Service]
 Type=simple
-ExecStart=@PREFIX@/@BINDIR@/beesd --no-timestamps %i
+ExecStart=@PREFIX@@BINDIR@/beesd --no-timestamps %i
 CPUSchedulingPolicy=batch
 CPUWeight=12
 IOSchedulingClass=idle

ppetr avatar Nov 04 '25 16:11 ppetr

-readonly bees_bin=$(realpath @DESTDIR@/@LIBEXEC_PREFIX@/bees)
+readonly bees_bin=$(realpath @DESTDIR@@LIBEXEC_PREFIX@/bees)

I think this should not have @DESTDIR@ because DESTDIR is the installation destination, e.g. to create installation images in a package manager. DESTDIR is not meant to be the final deployment location, it's the packaging location.

@Zygo This means, https://github.com/Zygo/bees/commit/66b00f8a972ebb4da68f7aa0d0656f43ce2a2c3a was partially wrong... Or completely wrong - and should be reverted...

kakra avatar Nov 04 '25 22:11 kakra