unit
unit copied to clipboard
Node.js: nginx unit does not start with postgres
Hi guys,
I'm having issues starting application when using postgres.
Container starts but it ends in loop of /usr/local/bin/docker-entrypoint.sh: Waiting for control socket to be removed...
and it never finishes.
When I remove the postgres client all works well. I've tried to close the client connection on sigterm but with no luck.
Did anybody meet the same issue?
I've prepared simple demo app to reproduce the issue: https://github.com/janliska/pgsql-nginx-unit-issue
I will look into this. Sorry for the long delay. It is prob because you are setting up another listener in js as well.
app.listen(8100, '0.0.0.0', async (err) => {
console.log('listening...', err);
});
I saw similiar issues running NGINX Unit in none daemonized mode (like in docker). Will send you a PR by the end of today.
I was able to reproduce it. It is not really related to node but more to the way we are handling the TERM signal. Thanks for bringing that to our attention. Will let you know once fixed.
The temp. fix is available and you are happy to test it. The official docker images will be updated accordingly.
https://gist.github.com/tippexs/125658d0c90b03f8fc5deac19a6322eb
Please clone the gist and replace the docker-entrypoint.sh
script with this one. Let me know if this is working.