Issue #6586
closedpulpcore-api.service fails to start on containers running systemd
Description
This affects the pulp_installer CI; it uses Ansible molecule to create docker containers running systemd, and installs/starts Pulp in it.
It also affects people running molecule locally for pulp_installer development.
The systemd service tasks/handlers technically succeed from Ansible's perspective, but they actually repeatedly fails to start.
journalctl _SYSTEMD_UNIT=pulpcore-api.service
shows this repeating:
Apr 27 19:45:27 fedora-31 systemd[1099]: pulpcore-api.service: Failed to set up mount namespacing: /run/systemd/unit-root/dev: Permission denied
Apr 27 19:45:27 fedora-31 systemd[1099]: pulpcore-api.service: Failed at step NAMESPACE spawning /usr/local/lib/pulp/bin/gunicorn: Permission denied
The issue appears to be in: pulp_installer.git/roles/pulp/templates/pulpcore-api.service.j2 These lines:
ProtectSystem=full
PrivateTmp=yes
PrivateDevices=yes
Require the container to have a higher set of capabilities, or perhaps even run privileged, to do bindmounts and possibly even namespaces. Specifying CAP_SYS_ADMIN in molecule.yml did not help.
git log
& git blame
revealed that these lines were added to all our services a while ago, but dropped from the other at misc points.
Possible solutions:
- Identify the exact set of capabilities it needs (working on this now, may not be possible)
- Make the container run privileged (xc94 didn't like doing this, and helped us limit privileges on containers)
- Drop those 3 lines. - Agreed upon on 7/31 for the sake of implementing #7259 quickly
- Make adding those protection lines configurable, and try to auto-detect whether the ansible managed environment (container) has capabilities. There is an ansible fact for capabilities.
Also, perhaps the systemd service tasks/handlers should have an argument to fail if the service actually fails to start?
Related issues
Updated by mdepaulo@redhat.com over 4 years ago
- Blocks Task #6585: Show the status page in pulp_installer CI added
Updated by fao89 over 4 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 71
Updated by bmbouter over 4 years ago
- Category set to Installer - Moved to GitHub issues
- Tags deleted (
Pulp 3 installer)
Updated by mdepaulo@redhat.com over 4 years ago
- Sprint deleted (
Sprint 77)
Removing from spring due to other higher priority work for me.
Updated by mdepaulo@redhat.com over 4 years ago
- Blocks Story #6584: As a pulp_installer CI user, I see verification that pulp functions and was installed correctly at the end added
Updated by pulpbot over 4 years ago
- Status changed from NEW to POST
Added by Mike DePaulo over 4 years ago
Added by Mike DePaulo over 4 years ago
Revision e6d4cbdc | View on GitHub
Problem: pulpcore-api.service fails to start on containers running systemd
Solution: Remove systemd namespace / sandboxing features from pulpcore-api systemd unit file.
Updated by Anonymous over 4 years ago
- Status changed from POST to MODIFIED
Applied in changeset ansible-pulp3|e6d4cbdceacc65417281f8bc26c42c1be34c1a9d.
Updated by ttereshc about 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Problem: pulpcore-api.service fails to start on containers running systemd
Solution: Remove systemd namespace / sandboxing features from pulpcore-api systemd unit file.
fixes: #6586 https://pulp.plan.io/issues/6586