Commit Graph
1 Commits
Author SHA1 Message Date
Omar Sobh 264ee81189 systemd: cluster daemon unit for production lifecycle
Pilot ran the cluster daemon under nohup; production needs proper
restart-on-failure + clean PATH inheritance (rustc gossip probe
needs `~/.cargo/bin` on PATH, which nohup's env didn't get).

The unit is user-scoped (`~/.config/systemd/user/`) so it works
without root on the pilot nodes:

  cp systemd/clawstor-cluster.service ~/.config/systemd/user/
  loginctl enable-linger $USER
  systemctl --user daemon-reload
  systemctl --user enable --now clawstor-cluster.service

Defaults:
- CLAWSTOR_BIN = ~/clawstor-deploy/claw-store
- CLAWSTOR_CONFIG = ~/clawstor-deploy/config.toml
- PATH prefixed with ~/.cargo/bin so rustc is found

Override any of those via `systemctl --user edit
clawstor-cluster.service`.

Security hardening:
- NoNewPrivileges=yes
- ProtectSystem=strict (system dirs read-only)
- ProtectHome=read-only (home dir read-only)
- ReadWritePaths=%h/clawstor-deploy (only the deploy tree is
  writable)
- PrivateTmp=yes

Restart semantics:
- Restart=on-failure with RestartSec=10 — pilot-verified: kill -9
  the daemon PID and the service comes back within ~10s
- TimeoutStopSec=60 so a slow gossip departure can complete

Deployed to tank + architect 2026-07-12 as part of the pilot
retest.
2026-07-12 06:07:30 -07:00