Phase 6d hotfix: systemd ExecStart needs %h #76

Merged
osobh merged 1 commits from phase-6d-fix-execstart into main 2026-07-14 19:30:58 +00:00
+13 -15
View File
@@ -6,22 +6,20 @@ Wants=clawstor-cluster.service
[Service] [Service]
Type=simple Type=simple
# Override via `systemctl --user edit clawstor-fuse.service` when the # systemd expands %h (home) at parse time so the ExecStart binary
# install lives elsewhere. # path resolves to an absolute path — env-var expansion in the
Environment=CLAWSTOR_FUSE_BIN=%h/clawstor-deploy/claw-fuse # executable position is NOT supported (results in status=203).
Environment=CLAWSTOR_DATA=%h/clawstor-deploy/data # Retarget via `systemctl --user edit clawstor-fuse.service`.
Environment=CLAWSTOR_MOUNT=%h/clawstor-mount # Create the mount point if missing (idempotent).
# Create the mount point if missing (idempotent). ExecStartPre runs ExecStartPre=/bin/mkdir -p %h/clawstor-mount
# BEFORE the actual mount; fusermount3 needs an existing dir.
ExecStartPre=/bin/mkdir -p ${CLAWSTOR_MOUNT}
# Best-effort pre-unmount in case a prior instance left a stale # Best-effort pre-unmount in case a prior instance left a stale
# mount (e.g. daemon SIGKILL). fusermount3's `-u -z` = lazy detach, # mount (e.g. daemon SIGKILL). Leading `-` = ignore failure.
# harmless when nothing is mounted. ExecStartPre=-/usr/bin/fusermount3 -u -z %h/clawstor-mount
ExecStartPre=-/usr/bin/fusermount3 -u -z ${CLAWSTOR_MOUNT} ExecStart=%h/clawstor-deploy/claw-fuse --data-dir %h/clawstor-deploy/data --mount %h/clawstor-mount
ExecStart=${CLAWSTOR_FUSE_BIN} --data-dir ${CLAWSTOR_DATA} --mount ${CLAWSTOR_MOUNT} # The FUSE binary blocks until unmounted. On systemd stop we
# The FUSE binary blocks until unmounted. On systemd stop, send # unmount explicitly rather than relying on the binary's SIGTERM
# SIGTERM which fuser translates to a clean unmount. # handler.
ExecStop=/usr/bin/fusermount3 -u ${CLAWSTOR_MOUNT} ExecStop=/usr/bin/fusermount3 -u %h/clawstor-mount
Restart=on-failure Restart=on-failure
RestartSec=5 RestartSec=5