Execute and control OS processes from Erlang/OTP with fine-grained management and proper cleanup.
Erlexec is an Erlang/OTP application that provides a robust interface for executing and managing operating system processes from within the Erlang VM. It solves the problem of unreliable external process management by offering significantly more control and better cleanup than the built-in `erlang:open_port/2` with `{spawn, Command}`, making it essential for systems requiring reliable interaction with OS processes.
Erlang and Elixir developers building systems that need to reliably execute, monitor, and control external OS processes, such as those in production environments managing shell commands, scripts, or long-running external services.
Developers choose Erlexec over alternatives because it provides production-ready, fine-grained control over OS process lifecycle, proper cleanup to prevent zombie processes, and features like pseudo-terminal support, user/group management, and flexible I/O redirection that are not available in Erlang's standard library.
Execute and control OS processes from Erlang/OTP
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Manages OS processes from start to termination with custom signals and kill commands, ensuring no zombie processes remain at VM exit, as highlighted in the README's cleanup guarantees.
Redirects STDOUT and STDERR to files, Erlang processes, or custom functions, with support for append/truncate modes and file permissions, demonstrated in examples like output to files or real-time monitoring.
Provides RFC4254-compliant PTY options for interactive processes, including terminal signal handling and echo control, essential for commands requiring terminal emulation.
Executes processes under different user credentials using Linux capabilities or sudo, with process group coordination and linking to Erlang processes for lifecycle sync.
Requires SUID bits or sudo rights for user switching, which the README warns can introduce security risks if misconfigured, especially when running as root.
Needs libcap-dev on Linux and a C++ port program built from source, adding deployment complexity and potential cross-platform limitations.
Examples and configuration are detailed but assume familiarity with Erlang/OTP and Unix process management, which may steepen the learning curve for newcomers.