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
run_setsid- Run a command in a new sessionrun_nohup- Run a command immune to SIGHUPprepare_session_acquisition- Prepare a Unix spawn-time session acquisition hook and sealed same-spawn receipt
§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§
- Nohup
Config - Configuration for nohup execution.
- Pending
Unix Session Receipt - Parent-side capability awaiting a positive child-hook acknowledgement.
- Setsid
Config - Configuration for setsid execution.
- Unix
Session Acquisition Hook - A non-cloneable Unix child hook that acquires a new session exactly once.
- Unix
Session Receipt - Opaque, single-use proof that the prepared child acquired a new session.
Enums§
- Nohup
Outcome - Outcome of nohup execution.
- Setsid
Outcome - 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.