Skip to main content

Module process

Module process 

Source
Expand description

The real task process: started in its own process group with a clean environment, its stdout and stderr written to the task’s log file and kept (their tail) for the ProcessResult.

This is the thin operating-system layer under crate::supervise; it is exercised by the integration tests (tests/processes.rs), the logic around it by unit tests.

Structs§

OsProcess
A started task process.
ProcessSpec
What to start.

Functions§

group_running
Whether a process of group still runs. A zombie (ended, not yet reaped) doesn’t: a forked task’s shim holds its leader as one, and an agent that is a container’s first process (or a subreaper) adopts its tasks’ orphans, which stay zombies until it reaps them. A process whose main thread ended (pthread_exit) shows as a zombie too while its other threads run: it still runs. Read from /proc; without it, whether the group has any process at all.
secure_log_dir
Readies the worker’s log directory for mode (B182), at its start: made if missing, its own mode the log mode’s readers’ (0700 for 0600, 0750 for 0640, 0755 for 0644), and every log already in it given mode, so those written before (an upgrade, a looser mode then) aren’t left readable until retention deletes them. A link in it is left alone, never followed.
set_log_mode
Sets the mode the worker’s log files get ([worker] log_mode): set on each file as it is opened, so the umask doesn’t change it.
spawn
Starts a task process.
spawn_passing
Starts a process that inherits pass (open, at the same descriptor number); the parent’s copy is closed once the child has it. Used to hand a runner its end of the agent’s socket pair.