Browse Source

Merge pull request #10785 from zmstone/0523-fix-windows-default-log-dir-environment-variable

fix(windows): set EMQX_LOG_DIR env variable
Zaiming (Stone) Shi 2 years ago
parent
commit
c15e2f8708
3 changed files with 13 additions and 2 deletions
  1. 9 2
      .github/workflows/build_packages.yaml
  2. 1 0
      bin/emqx.cmd
  3. 3 0
      changes/ce/fix-10785.en.md

+ 9 - 2
.github/workflows/build_packages.yaml

@@ -102,9 +102,16 @@ jobs:
     - name: run emqx
       timeout-minutes: 5
       run: |
+        $ErrorActionPreference = "Stop"
         ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx start
-        Start-Sleep -s 5
-        echo "EMQX started"
+        Start-Sleep -s 10
+        $pingOutput = ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx ping
+        if ($pingOutput = 'pong') {
+          echo "EMQX started OK"
+        } else {
+          echo "Failed to ping EMQX $pingOutput"
+          Exit 1
+        }
         ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx stop
         echo "EMQX stopped"
         ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx install

+ 1 - 0
bin/emqx.cmd

@@ -46,6 +46,7 @@
 @set "RUNNER_ROOT_DIR=%rel_root_dir%"
 :: hard code etc dir
 @set "EMQX_ETC_DIR=%rel_root_dir%\etc"
+@set "EMQX_LOG_DIR=%rel_root_dir%\log"
 @set "etc_dir=%rel_root_dir%\etc"
 @set "lib_dir=%rel_root_dir%\lib"
 @set "emqx_conf=%etc_dir%\emqx.conf"

+ 3 - 0
changes/ce/fix-10785.en.md

@@ -0,0 +1,3 @@
+Ensure `EMQX_LOG_DIR` is set by Windows boot script.
+
+The environment variable `EMQX_LOG_DIR` was missing in v5.0.25, caused EMQX Windows package fail to boot unless set by sysadmin.