A proxy restarted on a running VM (its company proxy settings changed,
say) was stopped with SIGTERM, and Proc.Stop took it as stopped as soon
as its arguments could no longer be read. An ending process loses its
memory before its files: on macOS kern.procargs2 fails some milliseconds
before its listening socket closes (every time, in a test of 30 stops),
and on Linux /proc/PID/cmdline reads empty. When Stop looked in that
window, Prepare found the VM's proxy port still taken, failed the launch
with proxy_port_taken and stopped the VM (Unproxied): e2e's company
proxy checks 15 and 17 failed in turn, and the checks after them found
the VM stopped.
- daemon.Proc.Stop waits until no process has the pid, or another
process does (Proc.ended); one whose arguments can't be read is still
ending.
- platform.ProcessArgs on Linux returns an error for an empty cmdline
(an ending or unreaped process), as macOS does, never [""].
- Tests: TestProcStopWaitsForTheEnd (fails before the fix: Stop returned
while the process still ran) and TestProcessArgsEnded.
- e2e: check prints a failed check's "failed: " lines first, then its
last lines (5, or check_lines); checks 15 and 17 are functions
(corp_through, corp_direct) whose steps each name themselves, then
corp_why shows the VM's status, its proxy, the launch's output, the
proxy's log and events, and the company proxy's log and events.
- docs: internals/network.md says when the old proxy counts as stopped.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A new VM can get network policy: --network-policy, else a question in a
terminal (no by default), else off. devvm makes its CA, writes the VM's
secret bindings, starts the VM's proxy (devvm _proxy, its password in a
file) and starts the VM confined to it, then runs the self-check before
the setup and the shell: a VM that isn't held to its proxy is stopped.
Tokens stay on the host; the hidden devvm secret get reads them for the
proxy, from the Keychain or a file. e2e gets a network section.
Co-Authored-By: Claude Opus 5.5 <[email protected]>