From 368393eacac339f9fe7d719fce990fb3f5fc8833 Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Tue, 17 Nov 2026 13:11:13 +0400 Subject: [PATCH] until comin status --json | jq -e '.deployer.deployment.generation.selected_commit_id == "$H" and (.deployer.deployment.status == "done" or .deployer.deployment.status == "failed")' >/dev/null; do sleep 10; done comin status --json | jq -r '.deployer.deployment.status' loginctl list-users --no-legend | awk '{print \$2, \$3}' | tr '\n' ' '; echo ls /var/lib/systemd/linger EOF git log --oneline -1 nixos: keep the login users' systemd managers running (linger) Every SSH login starts a user's systemd manager and the logout stops it: a git push as git, a CI deploy, an admin session. A switch that reloads user units while one is starting or stopping fails with status 4 although the system did switch, and comin reports the deployment as failed; at 08:50 a push as git did this on ops and the "Deploy failing" alert mailed. With linger the managers run permanently. Assisted-by: Claude:opus-5-5 --- nixos/modules/monitoring-agent.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/monitoring-agent.nix b/nixos/modules/monitoring-agent.nix index 49cbdd7..8ea9cf9 100644 --- a/nixos/modules/monitoring-agent.nix +++ b/nixos/modules/monitoring-agent.nix @@ -173,6 +173,15 @@ in }; config = { + # Their systemd user managers run permanently. Otherwise each SSH + # login (a git push as git, a CI deploy, an admin session) starts + # and stops one, and a switch that reloads user units at that moment + # fails with status 4 although the system switched; comin then + # reports the deployment as failed. + users.users = lib.genAttrs config.asxpio.security.loginUsers (_: { + linger = true; + }); + asxpio.security.loginUsers = [ "root" "asxpi"