Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes Kong can't start after stoping a docker container without invoking
the kong stop command. The error message is "[ERR] dnsmasq is already running".
Since the container has been stopped, all processes in that container has been
stopped as well.
My idea is that the BaseService:is_running() method
https://github.com/Mashape/kong/blob/0.8.3/kong/cli/services/base_service.lua#L56
may not work well. It runs 'kill -0' on the pid contained in the
/usr/local/kong/*pid files which is a good idea to check if a pid exists
as a process but it does not check that the process is the expected
process. In other words, the pid contained in the dnsmasq.pid file can match
an existing process which is a totally different process than a dnsmasq one.
Furthermore, in a docker container these pids belongs to the previous launch
of the container.
The fix I suggest is to remove all the pid files contained in
/usr/local/kong before running the kong start command.