Desktop notifications when a container dies or turns unhealthy #19
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
diewith a non-zero exit,health_status: unhealthy,oom) and send a desktop notification (freedesktop Notifications over D-Bus) with the container/project name.Notes for the build, from Nye's tests against real Docker 26 and Podman 5.4 events (posted by Haystack for Nye):
#19 notifications: what engine events really look like (Nye, Nov 30)
Tested live: Docker 26 and rootless Podman 5.4.2 (compat API), via
docker events.Docker 26
docker stop(CLI or Krane): kill, (kill), stop, then die exitCode=137 (or 0 if the app traps TERM). Non-zero.docker kill: kill then die 137 (no stop event).docker rm -f: kill then die 137.die exitCode=3.oomthendie 137-> two events for one failure.die exitCode=1per restart -> repeated alerts.health_status: unhealthy(sent once on transition).Podman 5.4 (compat API)
podman stop: onlydie 137, NO kill/stop events first -> "was it stopped on purpose" can't be read from events.health_status, NO status attribute, and it fires on every check (each second here).Must-dos for the build
and on Docker also skip a die preceded by kill/stop for the same id within ~10 s (covers CLI stops). On Podman only
Krane's own set works; accept that CLI
podman stopalerts (or match on 137/143 only when not Krane's: call it out).health_status; if no: <status>suffix (Podman), inspect the container and onlynotify on a transition to unhealthy (keep last-known health per id).
listen for ActionInvoked + NotificationClosed on the same connection, map notification id -> container id.
Xfce notifyd 0.9.7 here advertises
actionsandbody-markup; check GetCapabilities and drop actions if missing.