Ephemeral Castle: Vault Systemd Detail

Level 3 (Detail) — Systemd units and timers for the Vault runtime.

Concept

The Vault runtime on Hetzner uses systemd units for lifecycle management. The original design used Quadlet (Podman-in-systemd), but the .container generator proved unreliable on Podman 4.3.1 (TD-016), forcing a fallback to explicit Type=simple systemd units.

Unit Inventory

lushycorp-vault.service

FieldValue
Filelushycorp-vault.service.j2
Typesimple
PurposeMain Vault container runtime
Dependenciesnetwork-online.target
Restartalways

Runs: podman run ... vault server -config=/etc/vault/vault.hcl

vault-local-unseal.service

FieldValue
Filevault-local-unseal.service.j2
Typeoneshot
PurposeUnseal Vault on boot
DependenciesRequires lushycorp-vault.service, 5s wait
Restartno

Runs: {{ vault_bootstrap_dir }}/vault-local-unseal.sh

vault-snapshot-backup.service

FieldValue
Filevault-snapshot-backup.service.j2
Typeoneshot
PurposeTake and upload Raft snapshot to S3
Depends onlushycorp-vault.service must be active

vault-snapshot-backup.timer

FieldValue
Filevault-snapshot-backup.timer.j2
PurposeSchedule for snapshot backup service
Schedule(configured via defaults)

vault-remote-restore.service

FieldValue
Filevault-remote-restore.service.j2
Typeoneshot
PurposeRestore Vault from S3 snapshot
Used inC2 restore flow

Quadlet Issue (TD-016)

The original design used a lushycorp-vault.container.j2 Quadlet file (.container → Podman-generates systemd unit). On Podman 4.3.1 (the current Hetzner golden image), the Quadlet generator produced incorrect units that failed to start the container reliably.

The fallback was an explicit Type=simple systemd unit that calls podman run directly. This bypasses Quadlet but introduces minor technical debt regarding standard Podman service management.

Key Directories

PathPurpose
{{ vault_runtime_root }}/vault.hclVault configuration
{{ vault_tls_dir }}/TLS certs (ca.crt, server.crt, server.key)
{{ vault_data_dir }}/Raft data directory
{{ vault_bootstrap_dir }}/Unseal shares, lifecycle receipt

See Also