A child lands once
Placement is requested once; the birth applies its step, and one completion
builds the landing carried to every later reader. Placement::land
(core/src/process/launch/landing.rs) derives every ordinary direct Group.
Platform code applies Step and registers platform resources, but builds no
Group. What each landing lets a collector signal is
a-process-group-is-its-owners-to-signal.
- Requested placement is one decision.
Shell::group_ownersupplies stage membership or session permission and interactivity.Placement::commandselectsJoin,Tenant,InheritorNewSession;Placement::inputdetermines terminal stdin from the request. A pipeline selects its input once from its anchor handoff result and stores it for every stage. - The direct landing follows that request.
Inheritshares;NewSessionowns the child’s group;Joincarries its membership intoJoins;Tenantmints aLeader, lends to it and returnsOwnswith the opaque terminal hold. Non-tenants return an empty hold.Spawned<Group>carries the result. - A terminal handoff requires typed provenance.
Leadercertifies birth leading a fresh group in ral’s own session, not liveness. Its constructor is private tolanding.rs: only the tenant completion andspawn_leadermint it, each from the child pid itsStep::NewLeaderjust grouped. It is neitherClonenorCopy.PreparedTerminalLoan::lendaccepts only&Leader; a pgid, membership or session leader cannot be converted into one. The caller must still retain the unreaped child to pin the ID. - The envelope owns its placement. Linux’s
EnvelopedLaunch::spawncallsLaunch::bornwithStep::NewLeaderregardless of request and hands it the naming of the payload’s group; its landing is Linux-onlyGroup::Envelopedon that group, or on the monitor’s where the envelope names none. A requestedTenantretains readable stdin and a restoration-only hold, without handoff or key attribution.Confinement::denial_pidsreads the payload’s pids from the landed group. - The anchor receives a certificate, not an ordinary group.
Launch::spawn_leaderreturnsSpawned<Leader>with an empty terminal hold.AnchorProcesskeeps the certificate beside its child pin; the pipeline lends only after readiness. There is no runtime check that an ordinaryGrouphappened to beOwns. - A launch is spent by its spawn. Direct and enveloped spawns take their
launch by value.
Spawned<G>varies only its group field; terminal responsibility stays opaque, and nothing downstream recomputes placement. - One birth serves every landing and platform.
Launch::borncreates the child, names an envelope’s payload group, hears the launcher and lands, in that order; its landing receives the child’s own pgid and the payload’s.born_directis the same birth with no payload to name: its landing receives the child’s pgid alone, so a direct landing cannot be handed a payload group it would not address. - Failed birth retains the request through teardown.
bornkeeps the applied step, child, request and jail until the report and landing finish. The child is held in anUnlandeduntil it lands. Dropped unlanded, the guard kills the payload’s group if one was named, then the child’s fresh group exactly whenStep::leads(), while its unreaped leader pins the ID, then kills/reaps the child; an exitborndoes not write still tears down. Only then does dropping the request restore saved state, followed by jail release. The shell settles already-started drains before reporting; a pipeline first rolls back and joins. No drain callback retains a reaped group ID. An anchor handoff refusal can restore immediately: no stage exists and the anchor never changes modes, so input is withheld instead.
Why. A group kill must address a group the child actually leads, and a terminal loan must address a fresh leader in ral’s session. Deriving the landing once prevents platform disagreement; the certificate prevents an arbitrary numeric pgid from receiving a loan. Neither replaces the child pin.
See a-process-limit-binds-before-the-child-runs, an-external-end-to-end and cancellation.