Condukt.Sandbox.Local (Condukt v3.0.0)

Copy Markdown View Source

Sandbox that operates against the host filesystem and host shell.

This is the default sandbox. It carries a base :cwd (resolved at init/1) that all relative paths and command executions use as their root.

mount/3 is unsupported (the host filesystem is the sandbox).

Initializing

{:ok, sandbox} = Condukt.Sandbox.new(Condukt.Sandbox.Local, cwd: "/tmp")

Options:

  • :cwd — base directory for paths and commands (default File.cwd!/0)
  • :process_dir — where start_process/4 keeps each process's log and status (default condukt-processes in the system temporary directory)

Processes

start_process/4 runs a command through MuonTrap in a process under Condukt's own supervisor, registered by the id, rather than in the caller. The command outlives the caller and is found again by its id on the same node, but not across a node restart: MuonTrap stops it with the node, as it stops every command this sandbox runs. The command runs in a process group of its own, which stopping it and its timeout kill whole, so what it started in the background goes with it.