compat-systemd1, NOTIFY_SOCKET, binfmt y timer

- ente-systemd1-compat: org.freedesktop.systemd1.Manager. Cada Ente vivo
  del fractal aparece como `<label>.service`. ListUnits/GetUnit/
  GetUnitByPID consultan al bus interno (BusRequest::ListEntes). Start/
  Stop/Restart son stubs que loguen — Cards ya están en el grafo, no se
  inician/paran on-demand. Reload/ListUnitFiles/ListJobs vacíos.
  Properties: Version, Architecture, Features, Environment.

- ente-notify-compat: listener en /run/systemd/notify para sd_notify.
  Decodifica KEY=value lines (READY/STATUS/MAINPID/WATCHDOG/STOPPING)
  y log estructurado. Permisos 0666 para que cualquier proceso escriba.
- ente-soma inyecta NOTIFY_SOCKET=/run/systemd/notify en cada Ente
  encarnado (junto a ENTE_BUS_SOCK + ENTE_ID).

- ente-binfmt-compat: lee /usr/lib/binfmt.d, /etc/binfmt.d, /run/binfmt.d
  en orden. Cada línea no-comment se escribe a /proc/sys/fs/binfmt_misc/
  register. EEXIST silencioso (handler ya registrado por boot anterior).
  OneShot pattern.

- ente-timer-compat: scheduler cron 5-field UTC (min hour dom mon dow).
  Soporta `*`, `N`, `*/N` por field. Lee /etc/ente/timers.json. Tick
  alineado al próximo minuto exacto, evalúa todos los timers cada
  60s. Decompose epoch via Howard Hinnant Civil from days. fire() loguea
  por ahora — spawn real requiere SpawnRequest via bus.

3 shims añadidos: 0xa6 systemd1, 0xa7 notify, 0xa8 timer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sergio
2026-05-04 10:43:39 +00:00
parent 883c14dade
commit 227715a464
12 changed files with 915 additions and 0 deletions
Generated
+51
View File
@@ -317,6 +317,15 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
[[package]]
name = "ente-binfmt-compat"
version = "0.0.1"
dependencies = [
"anyhow",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "ente-brain"
version = "0.0.1"
@@ -459,6 +468,20 @@ dependencies = [
"zbus",
]
[[package]]
name = "ente-notify-compat"
version = "0.0.1"
dependencies = [
"anyhow",
"ente-bus",
"ente-card",
"libc",
"nix",
"tokio",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "ente-policy-provider"
version = "0.0.1"
@@ -523,6 +546,19 @@ dependencies = [
"tracing",
]
[[package]]
name = "ente-systemd1-compat"
version = "0.0.1"
dependencies = [
"anyhow",
"ente-bus",
"ente-card",
"tokio",
"tracing",
"tracing-subscriber",
"zbus",
]
[[package]]
name = "ente-timedated-compat"
version = "0.0.1"
@@ -536,6 +572,21 @@ dependencies = [
"zbus",
]
[[package]]
name = "ente-timer-compat"
version = "0.0.1"
dependencies = [
"anyhow",
"ente-bus",
"ente-card",
"serde",
"serde_json",
"tokio",
"tracing",
"tracing-subscriber",
"ulid",
]
[[package]]
name = "ente-tmpfiles-compat"
version = "0.0.1"