diff --git a/packages/mosaic/framework/systemd/user/mosaic-agent@.service b/packages/mosaic/framework/systemd/user/mosaic-agent@.service index f4d4a985..81f76b54 100644 --- a/packages/mosaic/framework/systemd/user/mosaic-agent@.service +++ b/packages/mosaic/framework/systemd/user/mosaic-agent@.service @@ -4,6 +4,14 @@ Documentation=https://git.mosaicstack.dev/mosaicstack/stack Requires=mosaic-tmux-holder.service After=mosaic-tmux-holder.service PartOf=mosaic-tmux-holder.service +# Do not attempt a seat before its generated env exists. `install` enables this +# unit (WantedBy=default.target) but on a roster-v2 fleet the reconciler owns the +# generated env, so between `install` and the first `apply`/`regen --write` there +# is a boot window where ExecStart would run against an absent env file and the +# launcher would fail the unit. A skipped unit is the honest state for "enabled +# but not yet configured"; systemd re-evaluates the condition on every start, so +# the seat comes up on the next start once the reconciler has written env. +ConditionPathExists=%h/.config/mosaic/fleet/agents/%i.env.generated [Service] Type=oneshot