container-services: queue the env-reload restart instead of blocking on it
The env-reload unit is a oneshot whose ExecStart was a blocking systemctl restart of the group unit. When the stack's cold start failed transiently (container-services-buzz on minipc1, where buzz-relay-1 came up unhealthy and compose exited 1), the group unit recovered on its own a few seconds later through its own Restart=on-failure, but the reload unit had already exited 1 with no restart policy and stayed failed until the next env file write. The trigger unit should queue the restart, not own the health of the whole stack: pass --no-block. Real failures still surface on the group unit, which carries Restart=on-failure and the start limit and is what the fleet scan reports.
This commit is contained in:
1 parent
0c265f7a74
commit
a8bc08de43
2 files changed
+4
-2
No files matched your search
@@ -52,5 +52,7 @@ If adding a new per-service option:
|
|||||||
- The group's unit sets `restartTriggers` to the files-write script, so editing any
|
- The group's unit sets `restartTriggers` to the files-write script, so editing any
|
||||||
`files` entry restarts the stack on the next switch (services that read files at
|
`files` entry restarts the stack on the next switch (services that read files at
|
||||||
startup, like Gitea templates, otherwise keep serving the old content)
|
startup, like Gitea templates, otherwise keep serving the old content)
|
||||||
- Env file changes trigger a path unit that restarts the stack (`container-services-<group>-env-reload.*`)
|
- Env file changes trigger a path unit that restarts the stack (`container-services-<group>-env-reload.*`);
|
||||||
|
the restart is queued with `systemctl restart --no-block`, so the reload unit does not wait for or
|
||||||
|
inherit the health of the stack it restarted
|
||||||
- Compose files are rendered to the store and staged to `/var/lib/container-services/<group>/compose.yml`
|
- Compose files are rendered to the store and staged to `/var/lib/container-services/<group>/compose.yml`
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
description = "Restart container service group '${groupName}' on env file changes";
|
description = "Restart container service group '${groupName}' on env file changes";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "${pkgs.systemd}/bin/systemctl restart container-services-${groupName}.service";
|
ExecStart = "${pkgs.systemd}/bin/systemctl restart --no-block container-services-${groupName}.service";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user