Skip to main content

launch_session_handling_sigterm

Function launch_session_handling_sigterm 

Source
pub fn launch_session_handling_sigterm(
    staged: StagedSession,
    on_url: impl FnOnce(&str),
) -> Result<LaunchResult, RuntimeError>
Expand description

launch_session for a process whose lifetime is this one session.

On unix an agent session takes SIGTERM over for the rest of the process: the first signal cancels every live task and ends the session through its normal teardown, a second exits at once with status 143, and [TERMINATE_TEARDOWN_DEADLINE] after the first the process exits with status 143 whatever it is doing. Those exits end the whole process, so nothing that outlives the session may share it. A script capsule, or a platform without SIGTERM, launches exactly as launch_session does.

It is also the one launch that honours a lifeline:

Whichever lifeline closes first while nothing else has begun the termination is the one whose record is written.