This can be used to define the Erlang cookie in a place that feels less foreign to
non Erlang users.
Fixes#3343
Cherry-picked from ejaberd upstream 20.04-91-g09454e165
This starts ejabberd without detaching process but setups
console logging to display only critical messages.
Cherry-picked from ejabberd upstream 20.12-73-g3516d2053
Without that change, when ERLANG_COOKIE environment is set, it complains:
/home/ejabberd/bin/ejabberdctl: line 76:
can't create /home/ejabberd/.erlang.cookie: Permission denied
Until now, when stopping the ejabberd container, Erlang is not gracefully
closed, Mnesia is not properly closed... exit code is 137.
With this change, when the container is stopped, Erlang receives the
SIGTERM signal, shutsdown, Mnesia database is properly closed, ...
and exit code is 0.
Reference: processone/ejabberd#2822