swarm-bao-forge-publisher re-runs on container start and token writes
The publisher was a oneshot with RemainAfterExit=true, started only through `wantedBy = container@hive-forge.service`. Once it had run it stayed `active (exited)`, so a later container start made its start a no-op: a token re-minted without a host reboot or a unit change never reached the store. - RemainAfterExit is dropped, so each start runs the script again. - systemd.paths.swarm-bao-forge-publisher watches the token file in the container (PathChanged) and starts the publisher when the mint writes it, the same shape as swarm-secret-publish's path unit. - The code comment, secrets.md and credentials.md now name both triggers; forge-placement pins the missing RemainAfterExit and the path unit. Refs #4998
This commit is contained in:
parent
c45f7a5330
commit
2d2d7529fc
4 changed files with 41 additions and 6 deletions
|
|
@ -294,6 +294,23 @@ let
|
|||
&& lib.elem "container@hive-forge.service" u.wantedBy
|
||||
&& !(allLocal.systemd.services ? hive-forge-swarm-controller-token);
|
||||
}
|
||||
{
|
||||
# What makes it re-run. A oneshot left `active (exited)` makes every later
|
||||
# start a no-op, so `RemainAfterExit` would silence both triggers: the
|
||||
# container's start (`wantedBy`, above) and a write of the token file.
|
||||
name = "the forge publisher re-runs on each container start and each write of the token file";
|
||||
ok =
|
||||
let
|
||||
p = allLocal.systemd.paths.swarm-bao-forge-publisher;
|
||||
in
|
||||
!((publisher allLocal).serviceConfig.RemainAfterExit or false)
|
||||
&&
|
||||
p.pathConfig.PathChanged
|
||||
== "/var/lib/nixos-containers/hive-forge/var/lib/forgejo/swarm-controller-token"
|
||||
&& p.pathConfig.Unit == "swarm-bao-forge-publisher.service"
|
||||
&& lib.elem "multi-user.target" p.wantedBy
|
||||
&& !(bare.systemd.paths ? swarm-bao-forge-publisher);
|
||||
}
|
||||
{
|
||||
# The absence arm: a forge host without the store has no leaf unless one
|
||||
# is placed, and the unit says which options to set.
|
||||
|
|
|
|||
Loading…
Reference in a new issue