Files
seaweedfs/seaweed-block/deploy/systemd/sw-blockmaster.service
T
pingqiuandClaude Opus 5.5 77e150d22e blockmaster: one HEAD reader, the layout catalog
The master read HEAD two ways with two settings: the layout catalog
(filer gRPC, --chunk-filer) for create and restore, and plain filer HTTP
?metadata=true (--workspace-head-base-url) for the workspace move admission
and the revoke ACK. The workspace reader now reads through the catalog it
already dials: BCatalog.ReadHeadObserved returns HEAD, decoded by the same
DecodeLayoutHeadEntry, with the entry's modification time from that same
lookup (seconds, as the HTTP metadata gave it). The proof mapping is
unchanged: identity from the master's lifecycle record, deleting, unclaimed,
detached, generation, epoch, holder and position; an absent HEAD refuses
with ErrHeadAbsent.

The HTTP reader and --workspace-head-base-url are deleted, with the unit's
and the env file's setting and the docs. The master tests run the same
refusal table against a catalog on the in-memory filer (the HTTP-only
redirect and envelope cases have no counterpart). The fixtures that passed
the flag give the master the filer flags instead; the head-size and F1
ladder masters had none and could not dial the catalog at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:29:50 -08:00

47 lines
1.4 KiB
Desktop File

# Example unit for blockmaster. Settings: /etc/sw-block/blockmaster.env
# (deploy/config/blockmaster.env). Create the user once:
# sudo useradd --system --no-create-home --shell /usr/sbin/nologin sw-block
[Unit]
Description=Seaweed Block master (epoch authority)
Documentation=https://github.com/seaweedfs/seaweed-block
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=sw-block
Group=sw-block
EnvironmentFile=/etc/sw-block/blockmaster.env
# systemd creates /var/lib/sw-block-master owned by User/Group. blockvolume
# units use their own state directories, never this one.
StateDirectory=sw-block-master
StateDirectoryMode=0750
ExecStart=/usr/local/bin/blockmaster \
--authority-store=${SWB_MASTER_AUTHORITY_STORE} \
--listen=${SWB_MASTER_LISTEN} \
--topology=${SWB_MASTER_TOPOLOGY} \
--expected-slots-per-volume=${SWB_MASTER_EXPECTED_SLOTS} \
--freshness-window=${SWB_MASTER_FRESHNESS_WINDOW} \
--pending-grace=${SWB_MASTER_PENDING_GRACE} \
--workspace-rpc=${SWB_MASTER_WORKSPACE_RPC} \
--workspace-max-clock-skew=${SWB_MASTER_WORKSPACE_MAX_CLOCK_SKEW} \
$SWB_MASTER_EXTRA_ARGS
# blockmaster stops on SIGTERM.
KillSignal=SIGTERM
TimeoutStopSec=30s
Restart=on-failure
RestartSec=5s
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
[Install]
WantedBy=multi-user.target