[erlang-questions] managing subprocesses

Dmitry Kolesnikov dmkolesnikov@REDACTED
Fri May 31 13:47:05 CEST 2013


Hello,

I've found this library useful for interaction shell commands: 
https://github.com/gleber/sh

If you are talking about daemons and supervise them then 
I've made a simple wrapper to supervise "external" processes and attache then to supervise tree
https://github.com/fogfish/feta/blob/master/src/osproc.erl

e.g.
supervisor:start_child(Sup, {
      jaba,
      {osproc, start_link, [java, jaba_spec()]},
      permanent, 1000, worker, dynamic
})

jaba_spec() -> ["-mx300m", "-cp", …]

- Dmitry


On May 30, 2013, at 10:52 PM, Timo Schrappe <schrappe.t@REDACTED> wrote:

> Hello,
> 
> I am wondering that there isn't a great way for managing and parsing subprocesses (through os:cmd/1) and their output.
> I spent some time with google and found erlexec which basically will do my job here. But it feels a bit cheesy to use an external module (or is it called application in erlang?) to use such a fundamental functionality.
> 
> I want to manage some shell scripts which will start some e.g. daemons.
> 
> 
> What is the erly way to do that kind of things? Im specially interested in the exit code from the bash scripts.
> 
> 
> - Timo
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list