Periodically send status to systemd
Description
With systemd it's possible to send a status line. This will show up when users run systemctl status puma.service.
Most of this code is based on puma-plugin-systemd.
At the moment this is completely untested, but I had written some code that I wanted to share. If anyone wants to finish this before I do, they should feel welcome to.
Closes #2604
Your checklist for this pull request
- [x] I have reviewed the guidelines for contributing to this repository.
- [ ] I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
- [x] My pull request is 100 lines added/removed or less so that it can be easily reviewed.
- [ ] If this PR doesn't need tests (docs change), I added
[ci skip]to the title of the PR. - [x] If this closes any issues, I have added "Closes
#issue" to the PR description or my commit messages. - [ ] I have updated the documentation accordingly.
- [ ] All new and existing tests passed, including Rubocop.
Happy to make this happen, but we should take the approach of providing APIs necessary for a plugin to provide this functionality.
This is still very much a draft since I didn't actually test this yet, but I took a stab at rewriting the systemd integration as a plugin that is automatically loaded. I wonder if this is a good direction to take. If so, I can clean up the patch and split it in two (first one that transforms it into a plugin, then one that adds status watching).
To me this looks great. I think if you rebase and add tests it's good to go.
I've rebased it to resolve conflicts, but I don't have time to write tests right now. If anyone does have the time, I'd highly welcome it.
Adding the contrib-wanted label.
Closing in favour of https://github.com/puma/puma/pull/3006