]> git.hungrycats.org Git - bees/commit
scripts: make OpenRC init delegate the mount to beesd
authorZygo Blaxell <bees@furryterror.org>
Wed, 24 Jun 2026 20:53:16 +0000 (16:53 -0400)
committerZygo Blaxell <bees@furryterror.org>
Tue, 6 Oct 2026 05:51:40 +0000 (01:51 -0400)
commitb31c7ca49e698531ef2b86a2bc1f9e50e2f0f6d8
treeb1122c3b20768559de52129f4a94a9a92bbfcd2f
parentb55ec0c6868ee10165c2b0c750050ee452bd7d27
scripts: make OpenRC init delegate the mount to beesd

The OpenRC init script mounted the btrfs filesystem itself in start_pre,
in the host mount namespace, and ran the bees binary directly.  That mount
was visible system-wide and leaked if stop_post did not run.  beesd (and
the systemd unit via PrivateMounts=yes) instead mount inside a private
slave-propagation namespace that is invisible to the rest of the system
and torn down automatically when bees exits.

Invoke `beesd --env-config ${fsuuid}` instead of bees directly, so the
mount, mount namespace, and BEESHOME/hash-table setup are all delegated to
beesd.  The script exports the configuration beesd reads in --env-config
mode (DB_SIZE, BEESHOME, BEESSTATUS, OPTIONS); start_pre is reduced to the
fsuuid/DB_SIZE checks and log-directory creation, and stop_post is dropped
because there is no host-namespace mount to clean up.  This removes the
duplicate mount/BEESHOME setup and gives OpenRC the same isolation and
cleanup semantics as the other two front ends.

bees options are passed through beesd's OPTIONS environment variable
rather than its command line: beesd's argument splitter would drop the
value of a space-separated option such as `--scan-mode 4`.

Assisted-by: Claude-Code:claude-opus-4-8
Signed-off-by: Zygo Blaxell <bees@furryterror.org>
scripts/bees.initd.in