Commit Graph

131 Commits

Author SHA1 Message Date
Ivan Dyachkov bc850281f2 build: use realpath instead of readlink
realpath works the same way in GNU and BSD systems
2022-09-07 21:31:58 +02:00
Zaiming (Stone) Shi ac840e318e refactor(cookie): Warning message when boot with default Erlang cookie 2022-09-06 18:58:35 +02:00
Zaiming (Stone) Shi 809f2ede09 fix(bin/emqx): ensure no crash dump when checking compatibility 2022-08-11 22:05:03 +02:00
Thales Macedo Garitezi 80d35feb33 fix(license): change schema to allow updating license to different type
Before this change, if a license in `emqx.conf` was of type
`key`/`file` and then changed to the opposite type, such change would
be saved to `{cluster,local}-overrides.conf`.  When the node restarts
after that, the configs are merged naively and becomes invalid, as it
contains both the `key` and `file` keys, and crashes.
2022-07-28 17:29:59 -03:00
Chris 24f88679ae feat: Added emqx command to check configs 2022-07-25 11:01:08 +02:00
Zhongwen Deng 0ee732c076 fix: typo error +ssl_dist_optfile to \-ssl_dist_optfile 2022-07-02 17:19:21 +08:00
Zaiming (Stone) Shi b3f16ccb36 fix: Erlang distribution over TLS 2022-06-28 21:49:02 +02:00
Zaiming (Stone) Shi 41808fc2a2 chore: add a comment to describe why setting ESCRIPT_NAME 2022-06-11 14:41:01 +02:00
Zaiming (Stone) Shi 8151f79f45 fix(bin/emqx): turn off debug print when need to capture stderror 2022-05-31 16:31:16 +02:00
Thales Macedo Garitezi d0c5de1da6
chore(config): move db configs under cluster/node keys 2022-05-26 14:02:22 -03:00
DDDHuang 809c0bede7 fix: check node name, regular expression 2022-05-19 09:52:00 +08:00
Zhongwen Deng 41268dba01 fix: can't get emqx's priv_dir when whitespace in install path 2022-05-05 15:59:14 +08:00
Shawn 7ee0887237 fix: ./bin/emqx_ctl status failed
The CLI emqx_ctl fails:

```
./bin/emqx_ctl status

Node not initialized?
Generated config file vm.*.args is not found for command 'ctl'
in config dir: /Users/liuxy/code/emqx50/_build/emqx/rel/emqx/-emqx_data_dir /Users/liuxy/code/emqx50/_build/emqx/rel/emqx/data --/configs
In case the file has been deleted while the node is running,
set environment variable 'EMQX_NODE__NAME' to continue
```
2022-04-23 15:07:58 +08:00
Zaiming (Stone) Shi ce902b5405 refactor(bin/emqx): speed up boot
The main slow-down is the overheads of booting up beam with the
'start_clean' boot file (which loads all modules).

Prior to this change, beam is started multiple times in order to
resolve configuration values.

After this change:
* For boot commands such as 'start', 'console' and
  'foreground', it starts beam twice:
  - 1st is to check platform compatibility
  - 2nd is to resolve all configs required for boot in a batch
* For non-boot commands, such as 'ctl' and 'ping', it does not
  require to start beam for config resolution at all
2022-04-22 11:35:50 +02:00
Zaiming (Stone) Shi 18cebd9be7 feat: parameterise console flavor
so we can start an Erlang console in a Elixir release
by: env EMQX_CONSOLE_FLAVOR=erl ./bin/emqx console
2022-04-13 23:29:17 +02:00
Zaiming (Stone) Shi 82ef4c87e5 fix(bin/emqx): configure mnesia dir in vm.args file 2022-04-13 21:55:05 +02:00
Zaiming (Stone) Shi 3c03c0cfc1 feat(bin/emqx): make possible to boot Erlang node from Elixir build 2022-04-13 21:55:05 +02:00
Zaiming (Stone) Shi 2dbc65cfe3 fix(bin/emqx): make possible to start in path with space 2022-04-13 21:55:05 +02:00
Zaiming (Stone) Shi 72405f977c refactor(bin/emqx): remove unnecessary intermediate env variables 2022-04-13 13:50:56 +02:00
Zaiming (Stone) Shi c8242816b0 refactor(bin/emqx): no need to template-render RUNNER_ROOT_DIR 2022-04-13 13:50:25 +02:00
Zaiming (Stone) Shi c62f7e5baa chore: fix typos in bin/emqx 2022-04-13 13:50:25 +02:00
Thales Macedo Garitezi b5ac56ba50
feat(db): check if OTP has mnesia_hook, otherwise fallback to mnesia
Adds a check to `bin/emqx` to see if the OTP version being used has
support for `mnesia_hook`, which is required by Mria for using the
RLOG backend.  If OTP is not compatible and the user tries to use
RLOG, a warning is printed during startup and the configuration falls
back to using the Mnesia backend.
2022-04-11 14:33:16 -03:00
Zaiming (Stone) Shi 32694e601a refactor: rename RUNNER_ETC_DIR to EMQX_ETC_DIR 2022-04-05 23:08:45 +02:00
Zaiming (Stone) Shi 822a4f9f73 feat: parameterise EMQX_ETC_DIR
both at build time and at runtime
2022-04-05 16:36:13 +02:00
Zaiming (Stone) Shi 122e75c0b4 feat(systemd): start EMQX under systemd in foreground mode 2022-03-11 13:34:54 +01:00
Zaiming (Stone) Shi 68fb80fc29 chore(bin/emqx): refine boot message 2022-03-04 21:02:54 +01:00
Zaiming (Stone) Shi 4e64010a3b build: more structured build info 2022-03-02 21:22:03 +01:00
Zaiming (Stone) Shi e22104476a fix(data_dir): get data_dir config in the right way
now data_dir config is respected by boot script as well as
EMQX application after booted
2022-02-28 09:59:56 +01:00
Zaiming (Stone) Shi 2e94880bb6 docs: More EMQ X -> EMQX rename in descriptive strings 2022-02-15 22:39:11 +01:00
Ilya Averyanov 64c59b5469 feat(license): check license before node start 2022-02-11 11:49:29 +03:00
Ilya Averyanov 17599432d1 feat(license): add license application 2022-02-07 19:05:47 +03:00
Thales Macedo Garitezi 1b3b2c0d03
feat: add eval-erl command to `bin/emqx`
This allows Erlang expressions to be evaluated easily even on nodes
running Elixir.
2022-02-04 16:53:27 -03:00
Thales Macedo Garitezi bd0d331b64
Merge pull request #6636 from emqx/elixir-packages-mkII
ci(mix): build emqx packages with elixir
2022-01-27 11:10:30 -03:00
Kian-Meng Ang fc92e4c8bf docs: fix typos 2022-01-27 12:29:38 +01:00
Thales Macedo Garitezi 03e0c5ef2a
fix(eval): use running node for rpc eval, not a fresh one
With the previous arguments, a fresh hidden node with the same name as
the expected running one was being started and commands were being run
there.  This caused commands like `ekka_cluster:info()` to report
seemingly weird results.
2022-01-26 16:59:48 -03:00
Zaiming (Stone) Shi 1abac892c9 refactor: install_upgrade script no need to re-pack
OTP release handler only works with .tar.gz
as a result, we had to unpack .zip and re-pack .tar.gz
just to make OTP happy.

Now since we will be building .tar.gz packages
there is no need for this re-pack step anymore
2022-01-13 18:54:01 +01:00
Zaiming (Stone) Shi a935dcc1f5
Merge pull request #6718 from zmstone/refactor-bin-emqx-help-info
refactor(bin/emqx): refine help info
2022-01-12 23:34:53 +01:00
Zaiming (Stone) Shi 38ee224fac refactor(bin/emqx): refine help info
* refine usage print
* deleted restart command, as it only works for daemon mode.
  e.g. if EMQ X is started in 'foreground' mode the 'restart'
  command will make it start in daemon mode
* some commands such as ertspath does not requre RPC
2022-01-12 23:33:59 +01:00
Zaiming (Stone) Shi 635b056e03 fix(bin/emqx): print usage when no command given 2022-01-12 08:18:44 +01:00
Zaiming (Stone) Shi af82f51333 chore: emqx stop prints ok after stop
This is to make it behave the same as older versions
2022-01-07 09:03:31 +01:00
Thales Macedo Garitezi b9494662ae
fix(ci): fix shellcheck file pattern
Since we started to use the portable shebang style for our scripts, we
need to update the pattern used to find scripts for Shellcheck to
check.
2022-01-05 11:34:04 -03:00
Zaiming (Stone) Shi eae2e3ad0c Merge remote-tracking branch 'origin/master' into merge-5.0-beta.3-to-master 2022-01-04 21:11:30 +01:00
Zaiming (Stone) Shi 320506957c refactor(bin/emqx): wait for up to 120 seconds by default 2022-01-04 17:28:53 +01:00
Zaiming (Stone) Shi 2898fa76e1 Merge remote-tracking branch 'origin/release-5.0-beta.3' into merge-5.0-beta.3-to-master 2022-01-03 11:39:06 +01:00
Thales Macedo Garitezi c70a47bba6
refactor(mix): undo the `bin/emqx` script split into helper files 2021-12-30 13:45:13 -03:00
Thales Macedo Garitezi 0020cf592f
Merge remote-tracking branch 'origin/master' into build-with-mix-mkII 2021-12-28 11:28:40 -03:00
Zaiming (Stone) Shi 68eb13d478 fix: portable shebang 2021-12-27 15:45:12 +01:00
Thales Macedo Garitezi 0655572f64
chore(mix): fix: use Elixir's own rpc-eval call for "eval" 2021-12-24 11:40:30 -03:00
Thales Macedo Garitezi 67cca5d3a1
chore(mix): use the same script in mix release as in rebar release
Surprisingly enough, by doing small cirurgical changes in the existing
EMQX control scripts, we are able to get it running with Elixir and
with existing functionalities (`console`, `remote_console`, `start`,
`stop`, `ctl`, `foreground`, `eval`).
2021-12-23 17:20:04 -03:00
Thales Macedo Garitezi 014b6d3cfd
chore(shellcheck): fix shellcheck linting warnings 2021-12-22 15:43:43 -03:00