Closed scottefein closed 9 years ago
Instead shouldn't it just exit with a warning?
You mean with a 0
status code, instead of 1
?
Yup, with status code 0.
On Mon, Oct 12, 2015 at 7:38 PM, Marco Palladino notifications@github.com wrote:
Instead shouldn't it just exit with a warning?
You mean with a 0 status code, instead of 1?
— Reply to this email directly or view it on GitHub https://github.com/Mashape/kong/issues/609#issuecomment-147549418.
Kong's behavior in this case is exactly the same as nginx. When nginx is being started again, but for some reason it cannot start because it's already running, it will return an error message with status 1
:
$ /usr/local/openresty/nginx/sbin/nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] still could not bind()
$ echo $?
1
I suppose what Kong really needs is a service script to handle this then. If NGINX operates the same way then it makes sense to leave it. Thanks! Closing.
kong/kong/cli/start.lua Currently it does the following:
However it seems like this is unexpected behavior. Instead shouldn't it just exit with a warning? I'm running into this as an issue when I "kong start" in puppet (errors if it's already up). Instead I'm forced to switch to using "kong restart". This is fine (as in it works) but not ideal.
Happy to make a pull request to change this...