fix(cmd): move unix domain sockets to /var/run
Summary
Unix domain socket files located in the prefix directory cause problems when mounting that directory in containers. In addition, it is common practice to store socket files in /var/run which is cleaned up automatically on server restart.
Checklist
- [ ] The Pull Request has tests
- [ ] A changelog file has been created under
changelog/unreleased/kongorskip-changeloglabel added on PR if changelog is unnecessary. README.md - [ ] There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE
Full changelog
- [Implement ...]
Issue reference
Fix KAG-328
it is common practice to store socket files in /var/run which is cleaned up automatically on server restart.
Note this only applies to containers, as /var/run is a volatile fs, which result in those files removed during container restart. We still need the manually remove the sockets so that
usage outside of containers doesn't break.
On the other side, I'm not sure if this change is worthwhile: does setting prefix to/var/run/kong for container
sufficient?
it is common practice to store socket files in /var/run which is cleaned up automatically on server restart.
I'm not sure if this change is worthwhile
@fffonion the problem scope is bigger than that, see KAG-328
Please also consider use cases when user doesn't start Kong through systemd (e.g. a plain kong start). In such case, even the ReadWritePaths I mentioned above won't work because no party is going to create that directory. So does the systemd-tmpfiles approach after a system reboot.
In conclusion, we need to consider following use cases:
- container based
- systemd controlled services
kong startAll above use cases should work with fresh install, or after a system (container) restart.