muontrap v0.4.3 MuonTrap.Daemon View Source
Wrap an OS process in a GenServer so that it can be supervised.
For example, in your children list add MuonTrap.Daemon like this:
children = [
{MuonTrap.Daemon, ["myserver", ["--options", "foo")], [cd: "/somedirectory"]]}
]
opts = [strategy: :one_for_one, name: MyApplication.Supervisor]
Supervisor.start_link(children, opts)
The same options as MuonTrap.cmd/3
are available with the following additions:
:log_output
- When set, send output from the command to the Logger. Specify the log level (e.g.,:debug
):stderr_to_stdout
- When set totrue
, redirect stderr to stdout. Defaults tofalse
.
Link to this section Summary
Functions
Get the value of the specified cgroup variable.
Modify a cgroup variable.
Returns a specification to start this module under a supervisor.
Return the OS pid to the muontrap executable.
Start/link a deamon GenServer for the specified command.
Link to this section Functions
Link to this function
cgget(server, controller, variable_name)
View Source
cgget(server, controller, variable_name)
View Source
cgget(GenServer.server(), binary(), binary()) :: binary()
cgget(GenServer.server(), binary(), binary()) :: binary()
Get the value of the specified cgroup variable.
Link to this function
cgset(server, controller, variable_name, value)
View Source
cgset(server, controller, variable_name, value)
View Source
cgset(GenServer.server(), binary(), binary(), binary()) :: :ok | no_return()
cgset(GenServer.server(), binary(), binary(), binary()) :: :ok | no_return()
Modify a cgroup variable.
Link to this function
child_spec(init_arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor
.
Link to this function
os_pid(server)
View Source
os_pid(server)
View Source
os_pid(GenServer.server()) :: non_neg_integer()
os_pid(GenServer.server()) :: non_neg_integer()
Return the OS pid to the muontrap executable.
Link to this function
start_link(command, args, opts \\ [])
View Source
start_link(command, args, opts \\ [])
View Source
start_link(binary(), [binary()], keyword()) :: GenServer.on_start()
start_link(binary(), [binary()], keyword()) :: GenServer.on_start()
Start/link a deamon GenServer for the specified command.