darkSheep404 commented on PR #10732: URL: https://github.com/apache/apisix/pull/10732#issuecomment-2314581089
> ### Description > In my last PR #10550, I place the unix socket files in `logs` directory. It may be inappropriate because if we use a container environment with log-rotate turned on, we may mount the `logs` folder to an external volume, and I think we may run into communication and permissions issues.↳ > > So this PR moves the sock files to the conf folder, which is probably a better choice because that's where we're generating our nginx.conf right now, and the same way we used to create conf_server sock file there previously.↳ > > In addition, this PR adds some code for cleaning up the sock file to ensure that when an Nginx process crashes or is killed, the sock file can be cleaned up before the next startup, preventing such errors (this is because the file already exists):↳ > > ``` > ✗ bin/apisix start > /usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua start > nginx.pid exists but there's no corresponding process with pid 1860232 , the file will be overwritten > nginx: [emerg] bind() to unix:/home/bzp/code/apisix/conf/worker_events.sock failed (98: Address already in use) > nginx: [emerg] bind() to unix:/home/bzp/code/apisix/conf/worker_events.sock failed (98: Address already in use) > ``` > > This often occurs when using containers, and we have to be able to handle it correctly. > > This feature has not yet been released, so fixing it now is timely and involves no compatibility issues. In the meantime, no test cases themselves need to be changed. > > ### Checklist > * [x] I have explained the need for this PR and the problem it solves > * [x] I have explained the changes or the new features added to this PR > * [ ] I have added tests corresponding to this change > * [ ] I have updated the documentation to reflect this change > * [x] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first) we may mount the logs folder to an external volume ==> we mount the logs folder to an external volume and we occur this issue worker_events.sock failed (98: Address already in use) after updgrate from 3.2 to 3.9 It seems like moving to the conf folder would be a better solution, since mount the logs folder is indeed a common behavior -- 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]
