[erlang-questions] run_erl logfiles and cron

Jay Doane <>
Thu Nov 28 04:35:18 CET 2013


Daniel,

Great clue!  A search for "pseudo tty cron" led me to this link:
https://www.linuxquestions.org/questions/linux-server-73/running-process-from-cron-with-ptty-588635/,
and an eventual solution like this:

@reboot screen -d -m ~/my_proj/rel/my_proj/bin/my_proj start

Thanks,
Jay


On Wed, Nov 27, 2013 at 4:29 PM, Szoboszlay Dániel <>wrote:

>  Hi,
>
> 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.)
>
> BR,
> Daniel
>
> On Wed, 27 Nov 2013 23:23:07 -0000, Jay Doane <>
> wrote:
>
> Hi,
>
> 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:
>
> @reboot ~/my_proj/rel/my_proj/bin/my_proj start
>
> where my_proj is built using "rebar compile generate".
>
> 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; *each log entry
> is suffixed with a ()1> prompt.*
>
> For example, here's a snippet of log started via cron (weird suffixes
> highlighted in red)
>
> Eshell V5.9.2  (abort with ^G)
> ()1>
> =INFO REPORT==== 27-Nov-2013::19:41:54 ===
> Registering 0 remote connections on node '
> '(
> )1>
> =INFO REPORT==== 27-Nov-2013::19:41:54 ===
> Node '' connected with 0 users
> ()1>
>
> And the same snippet later when started from bash:
>
> Eshell V5.9.2  (abort with ^G)
> ()1>
> =INFO REPORT==== 27-Nov-2013::19:56:42 ===
> Registering 0 remote connections on node '
> '
> =INFO REPORT==== 27-Nov-2013::19:56:42 ===
> Node '' connected with 0 users
>
> Can anyone give me any clues as to why this might be happening, and
> especially suggestions on how to stop it?
>
> Thanks,
> Jay
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131127/29366ef0/attachment.html>


More information about the erlang-questions mailing list