ejabberdctl.cfg ERL_OPTIONS make ejabberd crash
for ejabberd tuning, add extra erlang options in ejabberd.cfg,
ERL_OPTIONS="-mnesia dump_log_write_threshold 50000 -mnesia dc_dump_limit 40"
Then ejabberdctl start fail to start ejabberd, with CRASH REPORT
2014-02-21 10:35:25 =ERROR REPORT====
application_controller: syntax error before: '.':
2014-02-21 10:35:25 =CRASH REPORT====
crasher:
initial call: application_master:init/4
pid: <0.40.0>
registered_name: []
exception exit: {{bad_return,{{ejabberd_app,start,[normal,[]]},{'EXIT',{aborted,{aborted,{application_load_error,{bad_environment_value,[]}}}}}}},[{application_master,init,4,[{file,"application_master.erl"},{line,133}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}
ancestors: [<0.39.0>]
messages: [{'EXIT',<0.41.0>,normal}]
links: [<0.39.0>,<0.7.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 610
stack_size: 27
reductions: 112
neighbours:
Apparently those options cannot be provided when ejabberdctl does it.
You can ensure they are provided exactly where they will work, by adding the line yourself in the source code ejabberdctl.template or in ejabberdctl.example before copying it to where you will use it, like this:
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -157,6 +157,7 @@ start()
-noinput -detached \
-pa $EJABBERD_EBIN_PATH \
-mnesia dir \"\\\"$SPOOLDIR\\\"\" \
+ -mnesia dump_log_write_threshold 50000 -mnesia dc_dump_limit 40 \
$KERNEL_OPTS \
-s ejabberd \
-sasl sasl_error_logger \\{file,\\\"$SASL_LOG_PATH\\\"\\} \```
Thank you, badlop. It looks like the solution needed to recompile the ejabberd, and it's not convenient for changing the option value.
ejabberdctl know these ERL_OPTIONS options.
# define erl parameters
ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES $ERL_OPTIONS"
I avoid the error by delete the $ARGS \"$@\" in start,
# start server
start()
{
check_start
$EXEC_CMD "$ERL \
$NAME $ERLANG_NODE \
-noinput -detached \
-pa $EJABBERD_EBIN_PATH \
-mnesia dir \"\\\"$SPOOLDIR\\\"\" \
$KERNEL_OPTS \
-s ejabberd \
-sasl sasl_error_logger \\{file,\\\"$SASL_LOG_PATH\\\"\\} \
$ERLANG_OPTS "
}
I don't know why it works. Where the "." come from ?
what is your /bin/sh real shell ?
GNU bash, version 4.1.2
+1
Confirm this behaviour. GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
Its still same with ejabberd 14.07.
15.02 also has the issue.
I guess we should fix this in ejabberdctl, but for now you should escape space characters with a backslash, e.g.:
ERL_OPTIONS="-mnesia\ dump_log_write_threshold\ 50000\ -mnesia\ dc_dump_limit\ 40"
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.