Skip to content

guest: install.sh alone starts the Dot's units, after the VM proxy - #1456

Open
feder-cr wants to merge 1 commit into
mainfrom
boot-order
Open

feder-cr wants to merge 1 commit into
mainfrom
boot-order

Conversation

@feder-cr

Copy link
Copy Markdown
Owner

The Dot's units now start only from install.sh, after the VM proxy is set.

Why

The units were enabled. So from the second boot on, systemd started them at multi-user.target.

But install.sh runs later. cloud-init's final stage runs it, and that stage comes after the target (cloud-final.service is After=multi-user.target). install.sh is what sets up the VM proxy's firewall and tunnel.

A Dot's serial log shows dot-agentd and the engine up about 2 s before install.sh. In that window a Dot with a proxy could go out directly. install.sh's own comment claimed the opposite ("The units below start after this").

What changes

  • The three units lose [Install] and are never enabled.
  • install.sh starts them on every boot after the proxy, as it already did on the first boot.
  • install.sh removes the multi-user.target.wants links that an earlier runtime made.
  • Tests and docs/architecture.md follow.

Split out of #1455. #1455's in-Dot browser update will be replaced by a browser disk, which waits on an invisible-core change. This fix stands on its own.

Verified

  • vitest and tsc: 2210 tests through the pre-push gate.
  • Real-VM e2e: 16/16 on this commit, including the server restart, the VM killed and restarted, and the VM killed during an exec.
  • On a real Dot booted with the same change, the serial log reaches multi-user.target without the units. They start only after install.sh.

Known limit

On an existing Dot, the first boot with this runtime disk still has the units enabled from before. They start early that one time; from the next boot the order holds.

The units were enabled, so on every boot after the first systemd started them at multi-user.target, before
cloud-init's final stage ran install.sh (cloud-final.service is After=multi-user.target): a Dot's serial log shows
dot-agentd and the engine up about two seconds before install.sh, which is what sets the VM proxy's firewall and
tunnel. A Dot with a proxy could go out directly in that window, and install.sh's own comment said the opposite.

The units are no longer enabled (no [Install]): install.sh starts them on every boot after the proxy, as it already
did on the first, and removes the wants links an earlier runtime made. install.sh is also the first point of the
boot that has the seed's config.json, which the same final stage writes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant