Skip to contents

A thin convenience wrapper around [run_supervised_external_command()] for external tools (ADMIXTURE, fastStructure) whose callers parse stdout/stderr as line-oriented plain text and only need an exit status – the same return contract `system2(..., stdout = TRUE, stderr = TRUE)` provided, which these callers were originally built against, kept unchanged so their parsing logic did not need to change when supervision (timeout and process-tree cleanup) was added. Admission always uses the default single-thread requirement/policy (`new_module_resource_requirements()`, `new_execution_resource_policy()`) – this wrapper's whole purpose is adding a timeout, not resource-bounding, so it deliberately never rejects admission the way an unbounded `system2()` call never did either.

Usage

run_supervised_line_command(
  executable,
  args,
  working_directory,
  timeout_seconds
)

Arguments

executable

Executable name or path.

args

Character vector of command-line arguments.

working_directory

Existing directory the subprocess should run in.

timeout_seconds

Maximum wall-clock seconds before the process (and its full process tree) is killed and treated as a failure.

Value

A list with `output` (character vector of output lines, stdout followed by stderr, matching `system2()`'s combined-capture convention), `status` (integer exit status, or `NA_integer_` on timeout/launch failure – `system2()`'s own convention for an unresolvable execution), and `timed_out` (logical).