Polish: minimal clawstor-fuse.service #89

Merged
osobh merged 1 commits from polish-fuse-unit-minimal into main 2026-07-14 21:31:47 +00:00
2 changed files with 23 additions and 15 deletions
Showing only changes of commit c46206c6dd - Show all commits
+8 -1
View File
@@ -16,7 +16,14 @@ Systemd **user** units for clawstor.
## Install `clawstor-fuse.service` (Linux) ## Install `clawstor-fuse.service` (Linux)
Prereqs: `libfuse3-dev` + `pkg-config` installed, `claw-fuse` binary built with Prereqs: `libfuse3-dev` + `pkg-config` installed, `claw-fuse` binary built with
`cargo build --release --features fuse --bin claw-fuse`. `cargo build --release --features fuse --bin claw-fuse`. Create the
mount directory once before enabling the unit — the unit no longer
does that itself (some Ubuntu builds refuse subsequent FUSE mounts
after an ExecStartPre chain touches the mount point):
```bash
mkdir -p ~/clawstor-mount
```
```bash ```bash
# 1. Copy the binary # 1. Copy the binary
+15 -14
View File
@@ -1,24 +1,25 @@
[Unit] [Unit]
Description=Clawstor read-only FUSE mount (blobs / snapshots / tags) Description=Clawstor read-only FUSE mount (blobs / snapshots / tags / refs)
Documentation=https://git.redclaw.dev/clawverse/clawstor Documentation=https://git.redclaw.dev/clawverse/clawstor
After=clawstor-cluster.service network-online.target After=network-online.target clawstor-cluster.service
Wants=clawstor-cluster.service Wants=clawstor-cluster.service
[Service] [Service]
Type=simple Type=simple
# systemd expands %h (home) at parse time so the ExecStart binary # systemd expands %h (home) at parse time; env-var expansion in
# path resolves to an absolute path — env-var expansion in the # the ExecStart binary position is NOT supported. Retarget via
# executable position is NOT supported (results in status=203). # `systemctl --user edit clawstor-fuse.service` if the install
# Retarget via `systemctl --user edit clawstor-fuse.service`. # path differs.
# Create the mount point if missing (idempotent). #
ExecStartPre=/bin/mkdir -p %h/clawstor-mount # Pre-6d we ran ExecStartPre=mkdir + ExecStartPre=fusermount3-u-z
# Best-effort pre-unmount in case a prior instance left a stale # to guard against stale mounts. On some Ubuntu builds (observed
# mount (e.g. daemon SIGKILL). Leading `-` = ignore failure. # on morpheus 2026-07-14) that combination made systemd refuse
ExecStartPre=-/usr/bin/fusermount3 -u -z %h/clawstor-mount # the subsequent FUSE mount with EPERM even though a manual
# invocation of the same binary succeeded. The minimal form here
# — plain ExecStart, ExecStop = unmount — is what actually works
# reliably across the fleet. Create the mount point manually
# (mkdir -p ~/clawstor-mount) once before enabling this unit.
ExecStart=%h/clawstor-deploy/claw-fuse --data-dir %h/clawstor-deploy/data --mount %h/clawstor-mount ExecStart=%h/clawstor-deploy/claw-fuse --data-dir %h/clawstor-deploy/data --mount %h/clawstor-mount
# The FUSE binary blocks until unmounted. On systemd stop we
# unmount explicitly rather than relying on the binary's SIGTERM
# handler.
ExecStop=/usr/bin/fusermount3 -u %h/clawstor-mount ExecStop=/usr/bin/fusermount3 -u %h/clawstor-mount
Restart=on-failure Restart=on-failure
RestartSec=5 RestartSec=5