Skip to content

help request: lsof command not found while launching #6977

Description

@kwanhur

Description

Launch apisix failed via systemctl start apisix, I got the logs like

May 03 15:00:00 lvs systemd[1]: Starting apisix...
May 03 15:00:00 lvs apisix[13574]: /usr/local/openresty/luajit/bin/luajit ./apisix/cli/apisix.lua start
May 03 15:00:01 lvs apisix[13574]: sh: lsof: command not found
May 03 15:00:01 lvs apisix[13574]: nginx.pid exists but there's no corresponding process with pid         3876        , the file will be overwritten
May 03 15:00:02 lvs systemd[1]: Started apisix.
  1. lsof: command not found lsof tool not existed in minimal centos 7 environment. Better to check /proc/pid directory exist or not via lfs. attributes.
    "luafilesystem = 1.7.0-2",
  2. It should return while checking pid failed, log nginx.pid exists but there's no corresponding process with pid shouldn't output.

    apisix/apisix/cli/ops.lua

    Lines 723 to 738 in cc88a8d

    if pid then
    local lsof_cmd = "lsof -p " .. pid
    local res, err = util.execute_cmd(lsof_cmd)
    if not (res and res == "") then
    if not res then
    print(err)
    else
    print("APISIX is running...")
    end
    return
    end
    print("nginx.pid exists but there's no corresponding process with pid ", pid,
    ", the file will be overwritten")
    end

Environment

  • APISIX version (run apisix version): 2.13.1
  • Operating system (run uname -a): Linux lvs 3.10.0-327.4.5.el7.x86_64
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions