Add native systemd units
What does this MR do?
- This MR adds systemd units to use instead of the init script
- Adds an optional Gem to that puma can use systemd's readiness protocol (
Type=notify
)
This MR does mostly the same as !52433 (closed) (sorry @matthewmuscat I don't want to step on your toes, will happily close this one if yours gets momentum), but incorporates feedback from that MR and adds documentation and the sd_notify
gem so that puma can notify systemd that it is running, as described here
The services are mostly modelled on prior art in the Arch Linux packaging of GitLab
- gitlab-puma.service
- gitlab-sidekiq.service
- gitlab-workhorse.service
- gitlab-gitaly.service
- gitlab-mailroom.service
- gitlab.target
and OpenSuse
- gitlab-ce-puma.service
- gitlab-ce-sidekiq.service
- gitlab-workhorse.service
- gitaly.service
- gitlab.target
As !52433 (closed), this is a reaction to #299570 (closed) and addresses the continued problems even after the most basic functionality has been restored after two MRs.
In the longer term, adopting proper systemd support could allow for removing a lot of helper binaries used by the init script and opting into systemd's sandboxing capabilities - something I have left out in this MR, but which can be seen in the examples from Arch Linux - could greatly improve security.
Fixes: #299753 (moved)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
- [-] Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done