Bug 1469021 - SELinux blocks systemd-nspawn
SELinux blocks systemd-nspawn
Status: NEW
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2017-07-10 05:30 EDT by Ferry Huberts
Modified: 2017-08-08 13:29 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-07-12 08:55:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ferry Huberts 2017-07-10 05:30:22 EDT
Description of problem:
SELinux blocks systemd-nspawn

I have a Fedora 25 x64 Jenkins build machine.
It builds RPMs with mock, which uses systemd-nspawn.
These builds fail under the current policy, while they succeeded under a previous policy.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. see description

Actual results:

DEBUG util.py:606:  child environment: None
DEBUG util.py:533:  Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '61d6d0878d144554837f64551aa1f62c', '-D', '/var/lib/mock/fedora-25-x86_64-gradle-upstream.5JzSZZVEsj/root', '-a', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;<mock-chroot>\\007"', '--setenv=SHELL=/bin/bash', '--setenv=PS1=<mock-chroot> \\s-\\v\\$ ', '--setenv=HOSTNAME=mock', '--setenv=HOME=/builddir', '--setenv=TERM=vt100', '--setenv=LANG=en_US.UTF-8', '/usr/sbin/userdel', '-r', '-f', 'mockbuild'] with env {'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'SHELL': '/bin/bash', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'TERM': 'vt100', 'LANG': 'en_US.UTF-8'} and shell False
DEBUG util.py:307:  Unsharing. Flags: 134217728
DEBUG util.py:450:  Failed to register machine: Connection timed out
DEBUG util.py:450:  Parent died too early
DEBUG util.py:588:  Child return code was: 1


Expected results:

Additional info:

# groups jenkins
jenkins : jenkins mock
Comment 1 Ferry Huberts 2017-07-10 05:31:33 EDT
Setting 'setenforce 0' fixes the build, but is obviously not preferred
Comment 2 Ferry Huberts 2017-07-12 05:13:02 EDT
Might also be systemd-nspawn itself.
I did see some (parts of) jobs succeed and other fail while SELinux was in enforcing.
Comment 3 Ferry Huberts 2017-07-12 08:55:49 EDT
strange things are happening.
closing until I have a better idea of what is going on.
Comment 4 Ferry Huberts 2017-07-27 05:11:11 EDT
Ok, there might be a bad interaction here between systemd-nspawn and SELinux.
It failed again for me and setting SELinux to NOT enforcing fixed it again.

Note You need to log in before you can comment on or make changes to this bug.