mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
- The lock directory is created (0700) when missing; only a directory or lock file that cannot be created or opened refuses, with the cure (install the tmpfiles.d entry, or chown the directory and its lock files to the unit's user). - The lock file is opened read-only (an existing file first, created 0644 only when missing), so a lock file another user created stays lockable; it is never unlinked, and the next owner locks the same file. - A stale-root startup end carries its cure into the final exit line: exiting status=78 reason=superseded cure="...". - Tests: a cut's remote_lsn is locally durable at its HEAD CAS, and the root's crash image at the CAS reattaches and serves; the rolled-back copy makes no claim or PUT, admits no I/O, keeps its data and durable LSN; an exact copy at HEAD attaches; a read-only lock file is taken. - Invariants: INV-WS-ONE-PROCESS-PER-HOST-001 and its M4 edge; the rollback row names its test file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 lines
676 B
Plaintext
11 lines
676 B
Plaintext
# tmpfiles.d entry for the blockvolume host volume locks. Install as
|
|
# /etc/tmpfiles.d/sw-block.conf, then run `systemd-tmpfiles --create`.
|
|
# blockvolume creates the directory when it can and refuses to start when it
|
|
# cannot (the shipped units cannot: ProtectSystem=strict). Each volume takes an
|
|
# exclusive lock on /run/sw-block/locks/<volume id>.lock, so one host runs at
|
|
# most one live blockvolume per volume. The directory is owned by the
|
|
# unprivileged units' user (sw-block) and is 0700, so no other local user can
|
|
# create or hold a volume's lock. The root ublk unit reaches it as root.
|
|
d /run/sw-block 0755 root root -
|
|
d /run/sw-block/locks 0700 sw-block sw-block -
|