<div dir="ltr">Daniel,<div><br></div><div>Great clue! A search for "pseudo tty cron" led me to this link: <a href="https://www.linuxquestions.org/questions/linux-server-73/running-process-from-cron-with-ptty-588635/">https://www.linuxquestions.org/questions/linux-server-73/running-process-from-cron-with-ptty-588635/</a>, and an eventual solution like this:</div>
<div><br></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">@reboot </span><font face="arial, sans-serif">screen -d -m </font><span style="font-size:12.800000190734863px;font-family:arial,sans-serif">~/my_proj/rel/my_proj/bin/my_</span><span style="font-size:12.800000190734863px;font-family:arial,sans-serif">proj start</span></div>
<div><span style="font-size:12.800000190734863px;font-family:arial,sans-serif"><br></span></div><div><span style="font-size:12.800000190734863px;font-family:arial,sans-serif">Thanks,</span></div><div><span style="font-size:12.800000190734863px;font-family:arial,sans-serif">Jay</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 27, 2013 at 4:29 PM, Szoboszlay Dániel <span dir="ltr"><<a href="mailto:dszoboszlay@gmail.com" target="_blank">dszoboszlay@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div><div>Hi,</div><div><br></div><div>That's because cron doesn't allocate a pseudo tty for your program, so your node starts up with the old shell. (Hopefully some Linux guru will know how to fix it, but I have no idea.)</div>
<div><br></div><div>BR,</div><div>Daniel</div><div><div class="h5"><div><br></div><div>On Wed, 27 Nov 2013 23:23:07 -0000, Jay Doane <<a href="mailto:jay.s.doane@gmail.com" target="_blank">jay.s.doane@gmail.com</a>> wrote:<br>
</div><br><blockquote style="margin:0 0 0.80ex;border-left:#0000ff 2px solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>As an expedient, when the host is booted, I'm starting an erlang project with cron using something similar to the following in a crontab:</div>
<div><br></div><div>@reboot ~/my_proj/rel/my_proj/bin/my_proj start<br>
</div><div><br></div><div>where my_proj is built using "rebar compile generate".</div><div><br></div><div>While this *does* actually start the erlang project, the "run_erl" logfiles it generates differ from those that are generated when the project is started from the command line using the same command; <b>each log entry is suffixed with a (node@host)1> prompt.</b></div>
<div><br></div><div>For example, here's a snippet of log started via cron (weird suffixes highlighted in red)</div><div><br></div><div><div>Eshell V5.9.2 (abort with ^G)</div><div>(<a href="mailto:my_proj@production-useast1a-lr03.example.com" target="_blank">my_proj@production-useast1a-lr03.example.com</a>)1></div>
<div>=INFO REPORT==== 27-Nov-2013::19:41:54 ===</div><div>Registering 0 remote connections on node '<a href="mailto:my_proj@production-useast1a-lr04.example.com" target="_blank">my_proj@production-useast1a-lr04.example.com</a>'<span style><font color="#ff0000">(<a href="mailto:my_proj@production-useast1a-lr03.example.com" target="_blank">my_proj@production-useast1a-lr03.example.com</a>)1></font></span></div>
<div>=INFO REPORT==== 27-Nov-2013::19:41:54 ===</div><div>Node '<a href="mailto:my_proj@production-useast1a-lr04.example.com" target="_blank">my_proj@production-useast1a-lr04.example.com</a>' connected with 0 users<font color="#ff0000">(<a href="mailto:my_proj@production-useast1a-lr03.example.com" target="_blank">my_proj@production-useast1a-lr03.example.com</a>)1></font></div>
<div><br></div><div>And the same snippet later when started from bash:</div><div><br></div><div>Eshell V5.9.2 (abort with ^G)</div><div>(<a href="mailto:my_proj@production-useast1a-lr03.example.com" target="_blank">my_proj@production-useast1a-lr03.example.com</a>)1></div>
<div>=INFO REPORT==== 27-Nov-2013::19:56:42 ===</div><div>Registering 0 remote connections on node '<a href="mailto:my_proj@production-useast1a-lr04.example.com" target="_blank">my_proj@production-useast1a-lr04.example.com</a>'</div>
<div>=INFO REPORT==== 27-Nov-2013::19:56:42 ===</div><div>Node '<a href="mailto:my_proj@production-useast1a-lr04.example.com" target="_blank">my_proj@production-useast1a-lr04.example.com</a>' connected with 0 users</div>
</div><div>
<br></div><div>Can anyone give me any clues as to why this might be happening, and especially suggestions on how to stop it?</div><div><br></div><div>Thanks,</div><div>Jay</div></div>
</blockquote><br><br><br></div></div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">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></blockquote></div><br></div>