ejabberd icon indicating copy to clipboard operation
ejabberd copied to clipboard

ejabberdctl.cfg ERL_OPTIONS make ejabberd crash

Open adelzhang opened this issue 12 years ago • 9 comments

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:

adelzhang avatar Feb 21 '14 02:02 adelzhang

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\\\"\\} \```

badlop avatar Feb 24 '14 12:02 badlop

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 ?

adelzhang avatar Feb 25 '14 08:02 adelzhang

what is your /bin/sh real shell ?

cromain avatar Feb 25 '14 08:02 cromain

GNU bash, version 4.1.2

adelzhang avatar Feb 25 '14 09:02 adelzhang

+1

Confirm this behaviour. GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)

ogorun avatar May 15 '14 07:05 ogorun

Its still same with ejabberd 14.07.

sawantuday avatar Jan 22 '15 16:01 sawantuday

15.02 also has the issue.

developerworks avatar Mar 13 '15 08:03 developerworks

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"

weiss avatar Mar 13 '15 08:03 weiss

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.

lock[bot] avatar Jun 12 '19 13:06 lock[bot]