Unfortunately it did not help.<br><br><br>Sergej<br><br><div class="gmail_quote">On Thu, May 12, 2011 at 3:06 PM, Antoine Koener <span dir="ltr"><<a href="mailto:antoine.koener@gmail.com">antoine.koener@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><br><div><div class="im"><div>On May 12, 2011, at 08:54 , Rapsey wrote:</div><br><blockquote type="cite">
My current way to run erlang as daemon in ubuntu:<br><br>Script that executes erlang itself with my app:<br>#!/bin/sh<br>cd /path/to/ebin<br>erl +Bd +P 1000000 -env ERL_MAX_PORTS 100000 +K true +A 32 -mnesia dir '"/path/to/mnesia"' -eval "myapp:start()"<br>
  <br><br>Upstart file. Placed in /etc/init/nameofapp.conf. It runs erlang through dtach, which allows me to enter the console at any time and pipes outout to a logfile. To attach to erlang simply run: dtach -a /tmp/erl<br>
 There is one problem with this setup. sudo stop name_of_app does not work. </blockquote><div><br></div></div><div>What about:</div><div class="im"><div><blockquote type="cite">#!/bin/sh<br>cd /path/to/ebin<br>erl +Bd +P 1000000 -env ERL_MAX_PORTS 100000 +K true +A 32 -mnesia dir '"/path/to/mnesia"' -eval "myapp:start()"<br>
</blockquote></div><div><br></div></div><div>exec erl +Bd +P 1000000 -env ERL_MAX_PORTS 100000 +K true +A 32 -mnesia dir '"/path/to/mnesia"' -eval "myapp:start()"</div><div><br></div><div>The stop signal will then be received by erl and not /bin/sh </div>
<div><div></div><div class="h5"><br><blockquote type="cite">It will remove the job, but erlang won't actually be killed. If I want to turn the daemon off, I have to go to erl console through dtach and execute q().<br>
 <br>start on filesystem and net-device-up<br>stop on runlevel [06]<br><br>env HOME=/home/ubuntu<br>respawn<br>console output<br><br>script<br>exec start-stop-daemon --name NAME_OF_INSTANCE --start --chuid USER_TO_RUN_AS --exec /usr/bin/dtach -- -c /tmp/erl /PATH/TO/SCRIPT > /var/log/erl.log<br>
 end script<br><br><br>Sergej<br><br><div class="gmail_quote">On Wed, May 11, 2011 at 10:26 PM, Wes James <span dir="ltr"><<a href="mailto:comptekki@gmail.com" target="_blank">comptekki@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Does this help any:<br> <br> <a href="http://ubuntuforums.org/showthread.php?t=648425" target="_blank">http://ubuntuforums.org/showthread.php?t=648425</a><br>
 <font color="#888888"><br> -wes<br> </font><div><div></div><div><br> On Wed, May 11, 2011 at 2:22 PM, Hank Knight <<a href="mailto:hknight555@gmail.com" target="_blank">hknight555@gmail.com</a>> wrote:<br> > I am trying to start erl in daemon mode, using the -detached parameter.<br>
 ><br> > It runs correctly when initiated from a command line however it fails<br> > when initiated using rc.local at boot time.<br> ><br> > I am running Erlang on Ubuntu.<br> ><br> > Any ideas on how to get it to run in daemon mode at boot time?<br>
 ><br> > Thanks,<br> > Hank<br> > _______________________________________________<br> > erlang-questions mailing list<br> > <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
 > <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br> ><br> _______________________________________________<br> erlang-questions mailing list<br>
 <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
 </div></div></blockquote></div><br> _______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div></div><br></div></blockquote></div><br>