Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/#kong-community
Apache License 2.0
39.22k stars 4.81k forks source link

clean output of kong stop when no process is running #235

Closed ahmadnassri closed 9 years ago

ahmadnassri commented 9 years ago

should probably remove the second and third (empty) lines:

[INFO] Using configuration: /etc/kong/kong.yml
sh: 1: kill: No such process

[INFO] Removing pid at: /usr/local/kong/kong.pid
[ERR] Not running. Could not find pid: 176
subnetmarco commented 9 years ago

I think it's this line: https://github.com/Mashape/kong/blob/master/kong/cli/utils/signal.lua#L342

os.execute("kill -0 "..pid) == 0
thibaultcha commented 9 years ago

This is what I see now:

kong|master ⇒ kong stop
[INFO] Using configuration: /etc/kong/kong.yml
[ERR] Not running. Could not find pid at: /usr/local/kong/kong.pid

has this been resolved?

subnetmarco commented 9 years ago

It happens on an edge case scenario (not sure, but maybe when Kong is being killed but the PID file still has the old process id), and it also happens in the test: https://travis-ci.org/Mashape/kong/builds/69369029#L1028