Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect nspawn_args whenever doChroot is called #1456

Merged

Conversation

praiskup
Copy link
Member

Which also includes all doOutChroot(), because that method calls doChroot() internally.

This issue was found when trying to workaround an issue [1] when SELinux policy forbid systemd-machine to create a varlink socket and thus start. This resulted in systemd-nspawn not being able to register a machine. To workaround this, Tomáš added the following snippet to the configuration:

config_opts['nspawn_args'] = ['--register=no']

So that systemd-nspawn does not try to register the machine with systemd-machine. However, this had no effect (and the argument was not visible on command-line and still failed).

[1] https://issues.redhat.com/browse/RHEL-49567

Co-authored-with: Tomáš Hozza [email protected]

@praiskup
Copy link
Member Author

praiskup commented Sep 20, 2024

Please ignore the Pylint's similarity warning, it is an issue, but it is not a new thing (specific format that breaks csdiff comparison I believe).

praiskup added a commit to praiskup/mock that referenced this pull request Sep 20, 2024
This also includes all `doOutChroot()` calls, as that method internally
calls `doChroot()`.

The issue was identified when trying to work around a problem [1] where
the SELinux policy prevented `systemd-machined` from creating a varlink
socket, causing it to fail to start.  As a result, `systemd-nspawn`
could not register the machine.  Tomáš tried the following
configuration:

    config_opts['nspawn_args'] = ['--register=no']

This was intended to ensure that `systemd-nspawn` does not attempt to
register the machine with `systemd-machined`.  However, the
configuration had no effect (the argument was not visible in the
`systemd-nspawn` command line, and the original issue persisted).

[1] https://issues.redhat.com/browse/RHEL-49567

Co-authored-by: Tomáš Hozza <[email protected]>
Closes: rpm-software-management#1410
Closes: rpm-software-management#1456
@praiskup praiskup force-pushed the fix-chroot-bootstrap-nspawn-args branch from e3f6732 to d223072 Compare September 20, 2024 13:07
praiskup added a commit to praiskup/mock that referenced this pull request Sep 24, 2024
praiskup and others added 2 commits September 24, 2024 09:19
This also includes all `doOutChroot()` calls, as that method internally
calls `doChroot()`.

The issue was identified when trying to work around a problem [1] where
the SELinux policy prevented `systemd-machined` from creating a varlink
socket, causing it to fail to start.  As a result, `systemd-nspawn`
could not register the machine.  Tomáš tried the following
configuration:

    config_opts['nspawn_args'] = ['--register=no']

This was intended to ensure that `systemd-nspawn` does not attempt to
register the machine with `systemd-machined`.  However, the
configuration had no effect (the argument was not visible in the
`systemd-nspawn` command line, and the original issue persisted).

[1] https://issues.redhat.com/browse/RHEL-49567

Co-authored-by: Tomáš Hozza <[email protected]>
Closes: rpm-software-management#1410
Closes: rpm-software-management#1456
@praiskup praiskup force-pushed the fix-chroot-bootstrap-nspawn-args branch from 4ed9026 to 79cd1ad Compare September 24, 2024 07:19
Copy link
Member

@xsuchy xsuchy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@xsuchy xsuchy merged commit 7b92dc4 into rpm-software-management:main Sep 24, 2024
21 checks passed
xsuchy pushed a commit that referenced this pull request Sep 24, 2024
This also includes all `doOutChroot()` calls, as that method internally
calls `doChroot()`.

The issue was identified when trying to work around a problem [1] where
the SELinux policy prevented `systemd-machined` from creating a varlink
socket, causing it to fail to start.  As a result, `systemd-nspawn`
could not register the machine.  Tomáš tried the following
configuration:

    config_opts['nspawn_args'] = ['--register=no']

This was intended to ensure that `systemd-nspawn` does not attempt to
register the machine with `systemd-machined`.  However, the
configuration had no effect (the argument was not visible in the
`systemd-nspawn` command line, and the original issue persisted).

[1] https://issues.redhat.com/browse/RHEL-49567

Co-authored-by: Tomáš Hozza <[email protected]>
Closes: #1410
Closes: #1456
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants