feat(enroll): systemd units for agent/forwarder/engine + log-directory INI key

Rename log-file-path -> log-directory (maps to DECNET_LOG_DIRECTORY). Bundle
now ships three systemd units rendered with agent_name/master_host and installs
them into /etc/systemd/system/. Bootstrap replaces direct 'decnet X --daemon'
calls with systemctl enable --now. Each unit pins DECNET_SYSTEM_LOGS so agent,
forwarder, and deckies logs land at decnet.{agent,forwarder}.log and decnet.log
under /var/log/decnet.
This commit is contained in:
2026-04-19 05:46:08 -04:00
parent e67b6d7f73
commit 899ea559d9
9 changed files with 124 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ Shape::
[decnet]
mode = agent # or "master"
log-file-path = /var/log/decnet/decnet.log
log-directory = /var/log/decnet
disallow-master = true
[agent]
@@ -42,7 +42,7 @@ from typing import Optional
DEFAULT_CONFIG_PATH = Path("/etc/decnet/decnet.ini")
# The [decnet] section keys are role-agnostic and always exported.
_COMMON_KEYS = frozenset({"mode", "disallow-master", "log-file-path"})
_COMMON_KEYS = frozenset({"mode", "disallow-master", "log-directory"})
def _key_to_env(key: str) -> str:
@@ -69,7 +69,7 @@ def load_ini_config(path: Optional[Path] = None) -> Optional[Path]:
parser = configparser.ConfigParser()
parser.read(path)
# [decnet] first — mode/disallow-master/log-file-path. These seed the
# [decnet] first — mode/disallow-master/log-directory. These seed the
# mode decision for the section selection below.
if parser.has_section("decnet"):
for key, value in parser.items("decnet"):