kong icon indicating copy to clipboard operation
kong copied to clipboard

fix(cmd): move unix domain sockets to /var/run

Open brentos opened this issue 2 years ago • 4 comments

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/kong or skip-changelog label 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

brentos avatar Nov 08 '23 00:11 brentos

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 08 '23 00:11 CLAassistant

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?

fffonion avatar Nov 13 '23 04:11 fffonion

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

Tieske avatar Nov 13 '23 10:11 Tieske

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 start All above use cases should work with fresh install, or after a system (container) restart.

fffonion avatar Nov 21 '23 03:11 fffonion