OpenBSD has a different than Linux su:
1. `-c` before username is treated as login class;
2. it doesn't require `--` as arguments separator.
Without (1) it complains as:
su: no such login class: exec "$0" "$@"
and without (2):
-: --: not found
Here, I've added detection of OS via `uname -s` which routes to the
right `su`. I really think that other BSD may need it as well.
This should limit number of possible node names generated by and with that
prevent atom space exhaustion in ejabberd process.
On R23+ we switch to using native dynamic node features and on older
versions we iterate over small number of possible names and skip those
already in use.
Make sure that logger options that we extract from config file are put in
correct places when starting erl, directly after -ejabberd, custom
EJABBERD_OPTS should be places after them.
This fixes issue #4109
control+g is the correct way to enter shell break mode, as documented in
https://www.erlang.org/doc/apps/erts/tty
The ejabberdctl script included in installers use the included VT100,
and that may break when hitting control+c.
In that scenario let's explicitly recommend to not use control+c.
Thanks to Holger Weiß for the report.
In the packaged rpm the spool dir is set to:
```
: "${SPOOL_DIR:="/opt/ejabberd/database/$ERLANG_NODE"}"
```
However, `$ERLANG_NODE` is effectively set later (now in line 67), which effectively makes spool dir always in `...../ejabberd@localhost`
* Add log_burst_limit_* options
On our ejabberd deployment we were sometimes seeing more than 500
msgs/sec of legitimate traffic, however this was getting silently
dropped. Provide config options to enable this limit to be configured
from the config file.
* Pass new logging vars in via ejabberdctl
Rebar 2 expands {{erts-vsn}} to "erts-$vsn", Rebar 3 expands it to just
"$vsn". Make sure `make rel` doesn't end up with a "$vsn" directory
next to "erts-$vsn" (which happened when using Rebar 3), and make sure
that ejabberdctl expects both "erl" and "epmd" to be installed below
"erts-$vsn" (which it didn't when using Rebar 3).
Some distributions (such as Fedora) use /sbin/nologin as the login
shell for the ejabberd user. The newer version of ejabberdctl uses
su to perform the command if the INSTALLUSER invokes the script.
This commit adjusts the call to su so that it passes /bin/sh as
the shell to use so that it will work correctly when the ejabberd
user's shell is set to nologin.
Signed-off-by: Randy Barlow <randy@electronsweatshop.com>