How to run a non-OTP Erlang application on a remote server with nohup?
문제
I have an Erlang code file which is not an OTP application. I do not use rebar.
My Erlang script just does some calculations and writes result to the file result.txt
.
As the running time can be long, I would like to use nohup
to run it on a remote machine.
However, running
nohup erl -noshell -pa ebin -eval "my_script:my_fun(Arg1,Arg2)" -s init stop &
does not do anything: nohup.out
is created, but remains empty and result.txt
is not created at all.
The same command without nohup
erl -noshell -pa ebin -eval "my_script:my_fun(Arg1,Arg2)" -s init stop
works, creating the result.txt
file and returning ok.
How can I run my_script.erl through nohup
?
해결책
You need to use in your command line the option -detached
http://www.erlang.org/doc/man/erl.html search about "detached"
제휴하지 않습니다 StackOverflow