Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r556227795



##########
File path: apisix/cli/ops.lua
##########
@@ -375,6 +375,10 @@ end
 
 
 local function start(env, ...)
+    if env.is_root_path then
+        util.die("Error: It is forbidden to run APISIX in the /root 
directory.\n")

Review comment:
       Cause of the bug: After APISIX is started, the `worker process` has the 
authority of nobody ordinary user. When APISIX is in the /root directory, 
ordinary users do not have the authority to access the `/root` directory. 
Therefore, when APISIX is started, the error log `error.log` will show the 
following error message:
   
   ```
   init_worker_by_lua error: /root/apisix-2.1/apisix/init.lua:89: module 
'resty.worker.events' not found:
           no field package.preload['resty.worker.events']
           no file 
'/root/apisix-2.1//deps/share/lua/5.1/resty/worker/events.lua'
           no file 
'/root/apisix-2.1//deps/share/lua/5.1/resty/worker/events/init.lua'
           no file '/root/apisix-2.1/resty/worker/events.lua'
           no file '/root/apisix-2.1/resty/worker/events/init.lua'
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to