This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch release/2.13
in repository https://gitbox.apache.org/repos/asf/apisix.git

commit 4fb1b7a92f7c0dddc82085c91c281d3027e41ed2
Author: leslie <[email protected]>
AuthorDate: Thu Mar 31 11:45:25 2022 +0800

    fix: `env.lua` should use absolute path (#6758)
---
 apisix/cli/env.lua | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/apisix/cli/env.lua b/apisix/cli/env.lua
index 39422088d..cf4ffd6af 100644
--- a/apisix/cli/env.lua
+++ b/apisix/cli/env.lua
@@ -78,7 +78,14 @@ return function (apisix_home, pkg_cpath_org, pkg_path_org)
         end
     end
 
-    local openresty_args = [[openresty -p ]] .. apisix_home .. [[ -c ]]
+    -- pre-transform openresty path
+    res, err = util.execute_cmd("command -v openresty")
+    if not res then
+        error("failed to exec ulimit cmd \'command -v openresty\', err: " .. 
err)
+    end
+    local openresty_path_abs = util.trim(res)
+
+    local openresty_args = openresty_path_abs .. [[ -p ]] .. apisix_home .. [[ 
-c ]]
                            .. apisix_home .. [[/conf/nginx.conf]]
 
     local min_etcd_version = "3.4.0"

Reply via email to