View Source Stdio.Process (stdio v0.4.0)
Supervised system processes
fork(2) new system processes.
privileges
Privileges
No additional privileges required. If the Stdio supervisor process
is running as root, supervised processes will by default drop to an
unprivileged user.
operations
Operations
See Stdio.config/0 for configuration options.
creates a new session
sets the process priority [:priority=0]
sets resource limits defined in the
rlimitoption [:rlimit=coredumps disabled]sends the process a SIGKILL if the parent process exits
If the system process is running with root privileges:
sets additional groups as specified in the
groupoption [:groups=additional groups removed]drops privileges to the value of
uidandgidor a high UID system [:uid/gid=65536-131071]disables the ability of the process to escalate privileges [:setuid=false]
Warning
The generated UID/GID may overlap with existing users.
examples
Examples
iex> Stdio.stream!(
...> "ping -q -c 1 127.0.0.1 | grep -o PING",
...> Stdio.Process,
...> setuid: true
...> ) |> Enum.to_list()
[stdout: "PING\n", exit_status: 0]
Link to this section Summary
Link to this section Functions
Test if a Stdio process is running
@spec signal(:prx.task(), :prx.pid_t(), pos_integer() | atom()) :: :ok | {:error, :prx.posix()}
Signal a process by process group, falling back to PID