Skip to main content

Crate sysprims_session

Crate sysprims_session 

Source
Expand description

GPL-free session and process group management.

This crate provides cross-platform primitives for session and process group management, replacing GPL-licensed tools like setsid (util-linux) and nohup (coreutils).

§Provenance

All implementations are derived from POSIX specifications and BSD/MIT-licensed references. See docs/design/sysprims-session-behavioral-comparison.md for the full provenance record.

§Features

§Example

use sysprims_session::{run_setsid, SetsidConfig};

// Run a command in a new session (detached from terminal)
let result = run_setsid("sleep", &["60"], SetsidConfig::default());

Structs§

NohupConfig
Configuration for nohup execution.
PendingUnixSessionReceipt
Parent-side capability awaiting a positive child-hook acknowledgement.
SetsidConfig
Configuration for setsid execution.
UnixSessionAcquisitionHook
A non-cloneable Unix child hook that acquires a new session exactly once.
UnixSessionReceipt
Opaque, single-use proof that the prepared child acquired a new session.

Enums§

NohupOutcome
Outcome of nohup execution.
SetsidOutcome
Outcome of setsid execution.

Functions§

getpgid
Get the process group ID for a process.
getsid
Get the session ID for a process.
prepare_session_acquisition
Prepare a session-acquisition hook and its parent-side receipt capability.
run_nohup
Run a command immune to SIGHUP.
run_setsid
Run a command in a new session.
setpgid
Set the process group ID for a process.
setsid
Create a new session for the current process.