kwanhur commented on code in PR #7006:
URL: https://github.com/apache/apisix/pull/7006#discussion_r871329085
##########
apisix/cli/ops.lua:
##########
@@ -728,14 +730,16 @@ local function start(env, ...)
local pid = util.read_file(pid_path)
pid = tonumber(pid)
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
+ local signone = 0
+
+ local ok, err, err_no = signal.kill(pid, signone)
Review Comment:
You're right. Because of `-1` pid, it always gets success return from
[kill()](https://elixir.bootlin.com/linux/latest/source/kernel/signal.c#L3773).
Need to change it with another fake pid like `66666`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]