[swarm] swarmctl-host → DECNET_SWARMCTL_HOST so operators set the bind address once in decnet.ini; `decnet swarmctl` and the systemd unit both resolve it via envvar — no --host/--port pinned on ExecStart.
46 lines
1.4 KiB
Django/Jinja
46 lines
1.4 KiB
Django/Jinja
[Unit]
|
|
Description=DECNET Swarm Controller (master)
|
|
Documentation=https://git.resacachile.cl/anti/DECNET/wiki/SWARM-Mode
|
|
After=network-online.target decnet-api.service
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User={{ user }}
|
|
Group={{ group }}
|
|
WorkingDirectory={{ install_dir }}
|
|
EnvironmentFile=-{{ install_dir }}/.env.local
|
|
# Bind/port resolved from /etc/decnet/decnet.ini ([swarm] swarmctl-host /
|
|
# swarmctl-port) — falls back to 127.0.0.1:8770 when the keys are absent.
|
|
# Pass --host/--port on the ExecStart line only if you want to pin them
|
|
# regardless of what the INI says.
|
|
Environment=DECNET_SYSTEM_LOGS=/var/log/decnet/decnet.swarmctl.log
|
|
ExecStart={{ venv_dir }}/bin/decnet swarmctl
|
|
StandardOutput=append:/var/log/decnet/decnet.swarmctl.log
|
|
StandardError=append:/var/log/decnet/decnet.swarmctl.log
|
|
|
|
# No special capabilities — the controller issues mTLS certs and talks to
|
|
# workers over TCP on unprivileged ports.
|
|
CapabilityBoundingSet=
|
|
AmbientCapabilities=
|
|
|
|
# Security Hardening
|
|
NoNewPrivileges=yes
|
|
ProtectSystem=full
|
|
ProtectHome=read-only
|
|
PrivateTmp=yes
|
|
ProtectKernelTunables=yes
|
|
ProtectKernelModules=yes
|
|
ProtectControlGroups=yes
|
|
RestrictSUIDSGID=yes
|
|
LockPersonality=yes
|
|
# Reads/writes the CA bundle and the master DB.
|
|
ReadWritePaths={{ install_dir }} /var/log/decnet
|
|
ReadOnlyPaths=/etc/decnet
|
|
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|