devguide
devguide copied to clipboard
Add info for systemd based distros
Provide examples for managing the buildbot-worker service through systemd unit files for systemd based distributions.
Note I have just removed the Netlify integration, since we're using readthedocs preview build now.
I see. SELinux and systemd both treat /home as a privileged and restricted area. System services are generally not allowed to access /home tos prevents daemons from stealing ssh private keys, personal emails, or your cat pictures.
I know of four options to deal with this problem
- move buildbot out of
/home. For example deploy buildbot code to/opt/buildbotand use systemdRuntimeDirectory,StateDirectory, andLogsDirectory(/run, /var/log, ... see man systemd.exec) - run buildbot as systemd user service. You have to put the service file to
/home/buildbot/.config/systemd/user/buildbot.service, enable lingering withloginctl enable-linger buildbot, and start the service from a buildbot login shell (not su/sudo!) assystemctl --user enable --now buildbot.service. - create a custom SELinux policy, types, and file contexts for buildbot.
- make the init_t SELinux type permissive
semanage permissive -a init_t
I see. SELinux and systemd both treat
/homeas a privileged and restricted area. System services are generally not allowed to access/hometos prevents daemons from stealing ssh private keys, personal emails, or your cat pictures.I know of four options to deal with this problem
* move buildbot out of `/home`. For example deploy buildbot code to `/opt/buildbot` and use systemd `RuntimeDirectory`, `StateDirectory`, and `LogsDirectory` (/run, /var/log, ... see man systemd.exec)
That would go against the current guidelines of setting up a buildbot worker (or requiring a bigger overhaul) so I wouldn't go with that option.
* run buildbot as systemd user service. You have to put the service file to `/home/buildbot/.config/systemd/user/buildbot.service`, enable lingering with `loginctl enable-linger buildbot`, and start the service from a buildbot login shell (not su/sudo!) as `systemctl --user enable --now buildbot.service`.
This solution I liked the most, however the systemctl --user option is not available in RHEL7.
* create a custom SELinux policy, types, and file contexts for buildbot.
Maybe that would be the best way then. Any pointers on how to work with that?
* make the init_t SELinux type permissive `semanage permissive -a init_t`
Not sure I would like to change init_t
If this PR is still relevant, it should be updated after the devguide reorganization, reviewed, and merged.
If this PR is still relevant, it should be updated after the devguide reorganization, reviewed, and merged.
Thanks for the reminder. Is there an ETA for the devguide reorganization?
The devguide reorganization is done already, and there is now a conflict on the PR that must be resolved.
@stratakis can you merge main into your branch and resolve the conflict?
Rebased.
Thanks! @methane / @zware, can you (re-)review?