<br><br><div class="gmail_quote">On Mon, May 5, 2008 at 2:42 PM, Nick Gerakines <<a href="mailto:nick@gerakines.net">nick@gerakines.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There are a few ways to do what you want. Both of them involve using<br>
the -detached erl arg.<br>
<br>
If you are using an application you'll want to create a boot script<br>
using the .app and .rel file. I consider this crucial for deploying<br>
applications.<br>
<br>
erl -name myapp@`hostname` -noshell -detached -setcookie myappcookie -boot myapp<br>
<br>
If you've got a simple MFA that you want to run in the background you<br>
can do it with -s.<br>
<br>
Consider the module foo that exports the method bar:<br>
<br>
erl -name fooapp@`hostname` -noshell -detached +W w +A 1 +Ktrue<br>
-setcookie foocookie -s foo bar<br>
<br>
Just keep in mind that to connect to detached erlang nodes, you'll<br>
need to be sure your cookies match. Otherwise you should be good to<br>
go.<br>
<br>
I tend to do something like:<br>
<br>
$ erl -name fooapp_ctl@`hostname` -setcookie foocookie<br>
<br>
Eshell V5.6.1  (abort with ^G)<br>
(fooapp_ctl@hostname)1> ^G<br>
User switch command<br>
 --> r'fooapp@hostname'<br>
 --> c<br>
Eshell V5.6.1  (abort with ^G)<br>
(fooapp@hostname)1><br>
<br>
# Nick Gerakines</blockquote><div><br>thanks for the response, I got it working with -noshell, I am looking for more info on the .app option.<br>Can someone give me an example on passing arguments using the -s option?<br>
The docs are as clear on the actual syntax.<br><br>I have a function start(Port, Htdocs) that I want to call with 8888, "C:/htdocs" and I can't figure out what the appropriate syntax should be.<br></div></div>
<br>