# spinifex-unit-version: 3 [Unit] Description=Spinifex Predastore (S3-compatible Object Storage) PartOf=spinifex.target After=spinifex-nats.service Wants=spinifex-nats.service [Service] EnvironmentFile=-/etc/spinifex/telemetry.env # No MULGA_ROOT_TRACE_RATIO here: the sink's tail sampler sheds guest block I/O # instead, and it can see whether a trace errored. A head ratio decides before # the error exists, so it discarded failures at the same rate as successes. Type=simple Slice=spinifex-system.slice User=spinifex-storage Group=spinifex ExecStartPre=/var/lib/spinifex/wait-for-nats.sh ExecStart=/usr/local/bin/spx service predastore start Restart=on-failure RestartSec=5 # Bounds predastore's own graceful stop. viperblock's WAL flush writes into # predastore, but After= already stops viperblock first (within its own 150s # budget); this is the backstop if that ordering is ever bypassed. TimeoutStopSec=30 OOMScoreAdjust=-500 # Legitimately the most memory-hungry infra service (S3 buffering/caching); # High/Max stay well above idle so normal load isn't throttled, while still # bounding a leak short of the slice-wide cap. MemoryHigh=40% MemoryMax=55% Environment=SPINIFEX_CONFIG_PATH=/etc/spinifex/spinifex.toml Environment=SPINIFEX_PREDASTORE_CONFIG_PATH=/etc/spinifex/predastore/predastore.toml Environment=SPINIFEX_PREDASTORE_BASE_PATH=/var/lib/spinifex/predastore/ Environment=SPINIFEX_PREDASTORE_TLS_CERT=/etc/spinifex/server.pem Environment=SPINIFEX_PREDASTORE_TLS_KEY=/etc/spinifex/server.key Environment=SPINIFEX_PREDASTORE_ENCRYPTION_KEY_FILE=/etc/spinifex/predastore/encryption.key # Filesystem access NoNewPrivileges=yes ProtectSystem=strict PrivateDevices=yes ReadOnlyPaths=/etc/spinifex/predastore /etc/spinifex/spinifex.toml /etc/spinifex/master.key /etc/spinifex/server.pem /etc/spinifex/server.key /etc/spinifex/ca.pem ReadWritePaths=/var/lib/spinifex/predastore /var/log/spinifex # Hardening ProtectHome=yes PrivateTmp=yes RestrictSUIDSGID=yes LockPersonality=yes RestrictRealtime=yes RestrictNamespaces=yes ProtectClock=yes ProtectKernelTunables=yes ProtectKernelModules=yes ProtectKernelLogs=yes ProtectControlGroups=yes ProtectProc=invisible SystemCallArchitectures=native MemoryDenyWriteExecute=yes RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK CapabilityBoundingSet= ProtectHostname=yes KeyringMode=private RemoveIPC=yes LimitCORE=0 LimitNOFILE=65536 LimitNPROC=4096 [Install] WantedBy=spinifex.target