Prior to this change, 'true=emqx:is_running().' Erlang assertion
is evaluated before 'emqx start' command gives up waiting.
The Erlang assertion would result in a error level crash log
which can be confusing.
This commit changes the equals to 'true' check to bash script
instead.
Also deleted the log message which advised users to report an
issue in case timeout happens, because daemon mode is almost only
used in tests
When emqx is stopped, sometimes it found out that the process is at
zombie state and tries to get the parent PID but the process has already
finished in the meanwhile, printing an error message like this:
```
error: process ID list syntax error
Usage:
ps [options]
Try 'ps --help <simple|list|output|threads|misc|all>'
or 'ps --help <s|l|o|t|m|a>'
for additional help text.
For more details see ps(1).
WARNING: 281777 is marked <defunct>, parent:
ok
```
Only the first `-` in ERE need escaping to ensure it's not a command
option for `grep`.
The fix also tested on BSD grep 2.6 and works well.
More details:
https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html
> Regular expressions with stray backslashes now cause warnings, as
their unspecified behavior can lead to unexpected results.
For example, '\a' and 'a' are not always equivalent
<https://bugs.gnu.org/39678>.
Currently, Elixir expressions are evaluated on an EMQX node using the
'eval' command, which works for both Erlang and Elixir expressions.
This commit adds the new command 'eval-ex' exclusively for evaluating
Elixir expressions on Elixir nodes, similar to 'eval-erl' for Erlang.
Prior to this change, when EMQX daemon mode failed to start
it's not quite easy for users to understand what went wrong.
All the know is the node did not start in time
and then instructed to boot the node in 'console' mode wishing
for some logs.
However, the node might actuay be running, causing 'console' mode
to fail with a different reason.
With this change, after a filure of daemon mode boot,
we issue a diagnosis.
1. if node can not be found from ps -ef, instruct the user
to find information in erlang.log.N
2. if the node is found running, but not responding to pings
instruct the user to check if the node name is
resolvable and reachable
3. if the node is responding to pings but emqx app is not
running, then it's likely a bug. so the user is advised
to report a github issue.
If more than one node is boot from the same root directory
try to find the node by node name set in EMQX_NODE_NAME
or EMQX_NODE__NAME environment variable